31 #ifndef _BEZIER_TO_SBASIS
32 #define _BEZIER_TO_SBASIS
41 inline SBasis bezier_to_sbasis(
Coord const *handles,
unsigned order) {
43 return Linear(handles[0]);
45 return Linear(handles[0], handles[1]);
47 return multiply(Linear(1, 0), bezier_to_sbasis(handles, order-1)) +
48 multiply(Linear(0, 1), bezier_to_sbasis(handles+1, order-1));
53 inline D2<SBasis> handles_to_sbasis(T
const &handles,
unsigned order) {
55 for(
unsigned i = 0; i <= order; i++)
56 for(
unsigned j = 0; j < 2; j++)
57 v[j][i] = handles[i][j];
58 return D2<SBasis>(bezier_to_sbasis(v[0], order),
59 bezier_to_sbasis(v[1], order));
double Coord
Definition: coord.h:45