Added Distance
This commit is contained in:
parent
9608d125a4
commit
62bba63f19
|
@ -24,6 +24,9 @@
|
|||
History
|
||||
|
||||
$Log: not supported by cvs2svn $
|
||||
Revision 1.7 2004/05/10 10:58:35 ganovelli
|
||||
name of the constructor changed from LineType to Line3
|
||||
|
||||
Revision 1.6 2004/03/11 11:47:20 tarini
|
||||
minor updates, corrections, added documentations, etc.
|
||||
|
||||
|
@ -200,6 +203,13 @@ Point3<ScalarType> ClosestPoint( Line3<ScalarType,NORM> l, const Point3<ScalarTy
|
|||
return l.P(l.Projection(p));
|
||||
}
|
||||
|
||||
template <class ScalarType, bool NORM>
|
||||
ScalarType Distance(const Line3<ScalarType, NORM> &l,
|
||||
const Point3<ScalarType> &p) {
|
||||
Point3f o = l.ClosestPoint(p);
|
||||
return (o - p).Norm();
|
||||
}
|
||||
|
||||
/*@}*/
|
||||
|
||||
} // end namespace
|
||||
|
|
Loading…
Reference in New Issue