1#ifndef _CLASS_CURVE_CONVERSION
2#define _CLASS_CURVE_CONVERSION
17template <
typename Polynomial>
19 const typename Polynomial::curve_abc_t&
curve) {
20 typedef typename Polynomial::t_point_t t_point_t;
21 typedef typename Polynomial::num_t num_t;
25 for (std::size_t
i = 1;
i <=
curve.degree(); ++
i) {
37template <
typename Bezier>
39 if (
curve.degree() > 3)
40 throw std::invalid_argument(
41 "bezier_from_curve is only implemented for curves of degree <= 3.");
42 typedef typename Bezier::point_t point_t;
43 typedef typename Bezier::t_point_t t_point_t;
44 typedef typename Bezier::num_t num_t;
74template <
typename Hermite>
76 if (
curve.degree() > 3)
77 throw std::invalid_argument(
78 "hermite_from_curve is only implemented for curves of degree <= 3.");
79 typedef typename Hermite::pair_point_tangent_t pair_point_tangent_t;
80 typedef typename Hermite::t_pair_point_tangent_t t_pair_point_tangent_t;
81 typedef typename Hermite::point_t point_t;
82 typedef typename Hermite::num_t num_t;
interface for a Curve of arbitrary dimension.
struct to define constraints on start / end velocities and acceleration on a curve
Definition bernstein.h:20
Hermite hermite_from_curve(const typename Hermite::curve_abc_t &curve)
Converts a polynomial of order 3 or less/cubic bezier curve to a cubic hermite spline.
Definition curve_conversion.h:75
bool isApprox(const T a, const T b, const T eps=1e-6)
Definition curve_abc.h:25
Bezier bezier_from_curve(const typename Bezier::curve_abc_t &curve)
Converts a cubic hermite spline or polynomial of order 3 or less to a cubic bezier curve.
Definition curve_conversion.h:38
Polynomial polynomial_from_curve(const typename Polynomial::curve_abc_t &curve)
Converts a cubic hermite spline or a bezier curve to a polynomial.
Definition curve_conversion.h:18