1 #ifndef SimTK_SIMMATH_GEO_LINESEG_H_
2 #define SimTK_SIMMATH_GEO_LINESEG_H_
62 { setEndpoints(e0,e1); }
66 { e[0]=e0; e[1]=e1;
return *
this; }
70 { assert(which==0 || which==1); e[which] = p;
return *
this; }
77 bool isDegenerate(RealP tol = Geo::getDefaultTol<P>())
const
78 { assert(tol >= 0);
return calcLengthSqr() <=
square(tol); }
82 const Vec3P& getEndpoint(
int which)
const
83 { assert(which==0 || which==1);
return e[which]; }
89 { assert(which==0 || which==1);
return e[which]; }
109 {
return t*e[0] + (1-t)*e[1]; }
114 {
return (e[0]+e[1]) / RealP(2); }
124 RealP findDistanceToPoint(
const Vec3P& p2)
const
126 "Geo::LineSeg_::findDistanceToPoint(): Not implemented yet.");
127 return Geo::getNaN<P>();}
131 RealP findDistanceToPointSqr(
const Vec3P& p2)
const
133 "Geo::LineSeg_::findDistanceToPointSqr(): Not implemented yet.");
134 return Geo::getNaN<P>();}
149 #endif // SimTK_SIMMATH_GEO_LINESEG_H_