9 #ifndef _BEZIER_POLY_CONVERSION 10 #define _BEZIER_POLY_CONVERSION 33 template <
typename Bezier,
typename Polynom>
35 typedef typename Polynom::t_point_t t_point_t;
36 typedef typename Polynom::num_t num_t;
37 assert(curve.min() == 0.);
38 assert(curve.max() == 1.);
39 t_point_t coefficients;
40 Bezier current(curve);
41 coefficients.push_back(curve(0.));
43 for (std::size_t i = 1; i <= curve.degree_; ++i) {
44 current = current.compute_derivate(1);
46 coefficients.push_back(current(0.) / fact);
48 return Polynom(coefficients, curve.min(), curve.max());
66 #endif //_BEZIER_POLY_CONVERSION
unsigned int fact(const unsigned int n)
Computes factorial of a number.
Definition: bernstein.h:24
Definition: bernstein.h:20
interface for a Curve of arbitrary dimension.
Polynom from_bezier(const Bezier &curve)
Provides methods for converting a curve from a bernstein representation to a polynom representation...
Definition: bezier_polynom_conversion.h:34
struct to define constraints on start / end velocities and acceleration on a curve ...