18 #include "../../include/ecl/geometry/polynomial.hpp" 25 namespace blueprints {
53 coefficients << a_0, a_1;
70 coefficients << a_0, a_1;
92 (3/(dx*dx))*(dy) - (2/dx)*ydot_initial - (1/dx)*ydot_final,
93 (-2/(dx*dx*dx))*(dy) + (ydot_final + ydot_initial)/(dx*dx);
108 if ( x_initial != 0.0 ) {
128 double a_2 = yddot_initial/2;
129 double a_3 = (yddot_final - yddot_initial)/(6*dx);
130 double a_1 = (
y_final-a_0-a_2*dx*dx - a_3*dx*dx*dx)/dx;
131 coefficients << a_0, a_1, a_2, a_3;
132 if ( x_initial != 0.0 ) {
157 double a_1 = ydot_initial;
158 double a_2 = yddot_initial/2;
159 double a_3 = ( 20*(
y_final -
y_initial) - (8*ydot_final + 12*ydot_initial)*dx - (3*yddot_initial - yddot_final)*dx*dx )
161 double a_4 = ( 30*(
y_initial -
y_final) + (14*ydot_final + 16*ydot_initial)*dx + (- 2*yddot_final + 3*yddot_initial)*dx*dx )
163 double a_5 = ( 12*(
y_final -
y_initial) - (6*ydot_final + 6*ydot_initial)*dx - (yddot_initial - yddot_final)*dx*dx )
166 coefficients << a_0, a_1, a_2, a_3, a_4, a_5;
183 if ( x_initial != 0.0 ) {
206 return LinearPointSlopeForm(x_f, y_f, slope);
214 return CubicDerivativeInterpolation(x_i, y_i, ydot_i, x_f, y_f, ydot_f);
218 return CubicSecondDerivativeInterpolation(x_i, y_i, yddot_i, x_f, y_f, yddot_f);
226 const double x_f,
const double y_f,
const double ydot_f,
const double yddot_f) {
227 return QuinticInterpolation(x_i, y_i, ydot_i, yddot_i, x_f, y_f, ydot_f, yddot_f);
Blueprint for interpolating a cubic polynomial between end point conditions.
Embedded control libraries.
void apply(ecl::CubicPolynomial &polynomial) const
Apply the blueprint to configure an existing object.
Blueprint for interpolating a cubic polynomial between end point conditions.
Blueprint for interpolating a linear function connecting end point conditions.
void apply(ecl::QuinticPolynomial &polynomial) const
Apply the blueprint to configure an existing object.
void apply(ecl::LinearFunction &function) const
Apply the blueprint to configure an existing object.
ecl::QuinticPolynomial instantiate()
Instantiate a copy of the object that is blueprinted.
void apply(base_type &polynomial) const
Apply the blueprint to configure an existing object.
ecl::CubicPolynomial instantiate()
Instantiate a copy of the object that is blueprinted.
LinearInterpolation(const double x_i, const double y_i, const double x_f, const double y_f)
Constructor that properly configures/initialises the blueprint.
Polynomial< 1 > LinearFunction
Mathematical term for 1st order polynomials.
Coefficients & coefficients()
Handle to the coefficient array, use to initialise the polynomial.
ecl::LinearFunction instantiate()
Instantiate a copy of the object that is blueprinted.
void shift_horizontal(const double &shift)
Horizontal shift transform.
base_type instantiate()
Instantiate a copy of the object that is blueprinted.
Blueprint for interpolating a quintic polynomial between end point conditions.
Polynomial< 3 > CubicPolynomial
Mathematical term for 3rd order polynomials.
Representation of a polynomial function of n-th degree.
Polynomial< 5 > QuinticPolynomial
Mathematical term for 5th order polynomials.