RobotArmLib 0.0.6
Robot Arm Library [WIP]
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
rb::math::Polynomial Class Reference

A class for constructing polynomial function. More...

#include <polynomial.h>

Public Member Functions

 Polynomial ()
 Default Construction.
 
 Polynomial (const short deg, const double t=0.)
 Construct polynomial with given degree.
 
void coeffQuintic (const std::vector< double > &start, const std::vector< double > &end, const double &T)
 Compute the coefficients of quintic (fifth order) polynomial by giving initial conditions of start and end.
 
double getPosition (const double &T) const
 Get the value (position) of polynomial f(t) at time T.
 
double getVelocity (const double &T) const
 Get the 1st order differential value (velocity) of polynomial f(t) at time T.
 
double getAcceleration (const double &T) const
 Get the 2nd order differential value (acceleration) of polynomial f(t) at time T.
 
short getDegree (void) const
 Get the degree (order) of the polynomial function.
 
rb::math::VectorX getCoeff (void) const
 Get the coefficients of the polynomial function.
 

Protected Attributes

short degree_
 An integer indicate degree of polynomial.
 
rb::math::VectorX c_
 A vector of coefficient of polynomial.
 
double t_
 The duration (time) of polynomial function f(t).
 

Detailed Description

A class for constructing polynomial function.

Member Function Documentation

◆ coeffQuintic()

void rb::math::Polynomial::coeffQuintic ( const std::vector< double > &  start,
const std::vector< double > &  end,
const double T 
)
inline

Compute the coefficients of quintic (fifth order) polynomial by giving initial conditions of start and end.

Parameters
startinitial condition of f[0], fd[0], fdd[0].
endinitial condition of f[T], fd[T], fdd[T].
Tduration (time interval) of polynomial function.

◆ getAcceleration()

double rb::math::Polynomial::getAcceleration ( const double T) const
inline

Get the 2nd order differential value (acceleration) of polynomial f(t) at time T.

Parameters
Tthe value of a certain time.
Returns
double

◆ getCoeff()

rb::math::VectorX rb::math::Polynomial::getCoeff ( void  ) const
inline

Get the coefficients of the polynomial function.

Returns
rb::math::VectorX

◆ getDegree()

short rb::math::Polynomial::getDegree ( void  ) const
inline

Get the degree (order) of the polynomial function.

Returns
short

◆ getPosition()

double rb::math::Polynomial::getPosition ( const double T) const
inline

Get the value (position) of polynomial f(t) at time T.

Parameters
Tthe value of certain time.
Returns
double

◆ getVelocity()

double rb::math::Polynomial::getVelocity ( const double T) const
inline

Get the 1st order differential value (velocity) of polynomial f(t) at time T.

Parameters
Tthe value of a certain time.
Returns
double

The documentation for this class was generated from the following file: