如何在3d中获得点到平面的距离? [英] How to get distance from point to plane in 3d?
本文介绍了如何在3d中获得点到平面的距离?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个三角形,它的点分别是A,B,C和空间点(P).如何获得点到平面的距离?我需要计算从P到平面的距离,即使我的三角形距离很远(或不高于该点,如图所示).
I have a triangle with points A, B, C and Point in space (P). How can I get distance from point to plane? I need to calc distance from P to plane, even when my triangle lie far away(or not above to the point, like on picture).
点和三角形:
推荐答案
如果点是P(x1,y1,z1)
并且平面是ax+by+cz+d = 0
dist = Abs(a*x1+b*y1+c*z1+d) / Sqrt(a^2+b^2+c^2)
这篇关于如何在3d中获得点到平面的距离?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文