src/Utilities/pointDistances.hh
//------------------------------------------------------------------------------
// Find the point on a plane closest to the given point.
//------------------------------------------------------------------------------
Find the point on a plane closest to the given point.
Find the point on a plane closest to the given point .
inline
Dim<3>::Vector
closestPointOnPlane(const Dim<3>::Vector& p,
                    const Dim<3>::Vector& origin,
                    const Dim<3>::Vector& unitNormal) {
  REQUIRE(fuzzyEqual(unitNormal.magnitude2(), 1.0, 1.0e-10));
  return p + (origin - p).dot(unitNormal)*unitNormal;
}
inline Dim < 3 > :: Vector closestPointOnPlane ( const Dim < 3 > :: Vector & p , const Dim < 3 > :: Vector & origin , const Dim < 3 > :: Vector & unitNormal ) { REQUIRE ( fuzzyEqual ( unitNormal . magnitude2 ( ) , 1.0 , 1.0e-10 ) ) ; return p + ( origin - p ) . dot ( unitNormal ) * unitNormal ; }
Find the point on a plane closest to the given point.
Find the point on a plane closest to the given point .