A polynomial of arbitrary order and dimension. More...
#include <polynomial.h>
Public Types | |
enum | Coefficients { A = 0, B, C, D, E, F, G, H, I, J } |
Public Member Functions | |
double | GetDerivativeWrtCoeff (double t, Dx poly_deriv, Coefficients coeff) const |
The derivative of the polynomial with respect to the coefficients. | |
State | GetPoint (double t) const |
Polynomial (int poly_order, int poly_dim) | |
Constructs a polynomial with zero coefficient values. | |
virtual | ~Polynomial () |
Protected Attributes | |
std::vector< VectorXd > | coeff_ |
Private Attributes | |
CoeffIDVec | coeff_ids_ |
A polynomial of arbitrary order and dimension.
A polynomial, e.g. 5th order is defined as: f(t) = Ft^5 + Et^4 + Dt^3 + Ct^2 + Bt + A fd(t) = 5Ft^4 + 4Et^3 + 3Dt^2 + 2Ct + B fdd(t) = 20Ft^3 + 12Et^2 + 6Dt + 2C
This class is responsible for calculating the values f(t) and higher order derivatives from the coefficient values.
Definition at line 53 of file polynomial.h.
Definition at line 55 of file polynomial.h.
towr::Polynomial::Polynomial | ( | int | poly_order, |
int | poly_dim | ||
) | [explicit] |
Constructs a polynomial with zero coefficient values.
poly_order | The highest exponent of t, e.g. 5-th order -> t^5. |
poly_dim | The dimensions of f(t), e.g. x,y,z. |
Definition at line 38 of file polynomial.cc.
virtual towr::Polynomial::~Polynomial | ( | ) | [virtual] |
double towr::Polynomial::GetDerivativeWrtCoeff | ( | double | t, |
Dx | poly_deriv, | ||
Coefficients | coeff | ||
) | const |
The derivative of the polynomial with respect to the coefficients.
t | The time at which the derivative should be evaluated. |
poly_deriv | Which polynomial derivative f(t), fd(t), function to use. |
coeff | The coefficient with respect to which to calculate the derivative. |
Definition at line 64 of file polynomial.cc.
State towr::Polynomial::GetPoint | ( | double | t | ) | const |
Definition at line 47 of file polynomial.cc.
std::vector<VectorXd> towr::Polynomial::coeff_ [protected] |
Definition at line 83 of file polynomial.h.
CoeffIDVec towr::Polynomial::coeff_ids_ [private] |
Definition at line 86 of file polynomial.h.