52 #define ACG_BEZIERCURVE_C 57 #include "BezierCurveT.hh" 69 template <
class Po
int>
75 std::vector<Point> b(*
this);
77 unsigned int n = b.size()-1, k;
78 Scalar t0(1.0-_t), t1(_t);
84 for (j=0, k=n-i; j<k; ++j)
85 b[j] = t0*b[j] + t1*b[j+1];
95 template <
class Po
int>
101 std::vector<Point> b(*
this);
104 Scalar t0(1.0-_t), t1(_t);
108 _curve0.reserve(n+1);
110 _curve1.reserve(n+1);
112 std::vector<Point> tmp;
120 _curve0.push_back(b[0]);
121 tmp.push_back(b[n-i]);
123 for (j=0, k=n-i; j<k; ++j)
124 b[j] = t0*b[j] + t1*b[j+1];
127 _curve0.push_back(b[0]);
132 _curve1.push_back(tmp[i]);
135 assert(_curve0.
degree() == n);
136 assert(_curve1.
degree() == n);
Namespace providing different geometric functions concerning angles.
void subdivide(Scalar _t, Self &_curve0, Self &_curve1) const
unsigned int degree() const
return degree (= size()-1)
Point operator()(Scalar _t) const
evaluate curve at parameter _t using deCasteljau