public static double distance ( PlaneGeneral3D_F64 plane , Point3D_F64 point ) { double top = plane . A * point . x + plane . B * point . y + plane . C * point . z - plane . D ; return top / Math . sqrt ( plane . A * plane . A + plane . B * plane . B + plane . C * plane . C ) ; }
Distance between a plane and a point . A signed distance is returned where a positive value is returned if the point is on the same side of the plane as the normal and the opposite if it s on the other .