点到平面的距离

1.1 面的表示方法

由上图可以知道

n(p-p0) = 0;

d = -np0   由此可以知道,d的几何意义

所以有:np+d = 0;为平面方程,其中p为平面上的任意一点,n为平面的单位法向量,

如果空间中一点Px,如果nPx + d = 0,那么Px在(np+d=0)表示的平面上,如果大于0,该点在平面的上面(法线所指的方向),如果小于0,该点在平面的下面。

1.2 几何推理

1.3 函数实现:

/** This is a pseudodistance. The sign of the return value is

            positive if the point is on the positive side of the plane,

            negative if the point is on the negative side, and zero if the

            point is on the plane.

            @par--

            The absolute value of the return value is the true distance only

            when the plane normal is a unit length vector.

        */

Real Plane::getDistance (const Vector3& rkPoint) const

{

                   return normal.dotProduct(rkPoint) + d;//为平面方程中的d

}

1.4 点到平面的距离公式  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值