void Bezier<POINT>::TVec( const float t, POINT &point) const { XTRACE(); float t2 = 2*t; float tt3 = 3*t*t; for( int d=0; d<point.dimension(); d++) { point.set(d, pd[d][1] + t2*pd[d][2] + tt3*pd[d][3]); } }
void Bezier<POINT>::Pos( const float t, POINT &point) const { XTRACE(); float tt = t*t; float ttt = t*tt; for( int d=0; d<point.dimension(); d++) { point.set(d, pd[d][0] + t*pd[d][1] + tt*pd[d][2] + ttt*pd[d][3]); } }
void Bezier<POINT>::PVec( const float t, POINT &point) const { XTRACE(); float t2 = 2*t; float tt3 = 3*t*t; if( point.dimension() != 2) return; //vector perpendicular to tangent at t // x/y -> -(y/x) point.set(1, pd[0][1] + t2*pd[0][2] + tt3*pd[0][3]); point.set(0,-(pd[1][1] + t2*pd[1][2] + tt3*pd[1][3])); }