hermite  0.0.1
Public Member Functions | List of all members
hermite::HermiteUnit< D > Class Template Reference

Interpolates on the unit interval. More...

#include <hermite_unit.hpp>

Inheritance diagram for hermite::HermiteUnit< D >:
Inheritance graph
[legend]
Collaboration diagram for hermite::HermiteUnit< D >:
Collaboration graph
[legend]

Public Member Functions

 HermiteUnit ()=default
 Default constructor. More...
 
 HermiteUnit (const Vector< D > p0, const Vector< D > p1, const Vector< D > v0, const Vector< D > v1)
 Constructor. More...
 
 HermiteUnit (const HermiteUnit< D > &other)
 Copy constructor.
 
HermiteUnit< D > & operator= (const HermiteUnit< D > &other)
 Assignment operator.
 
 ~HermiteUnit () override=default
 Destructor.
 
Vector< D > getPos (const double t) const override
 Gets position at a certain time. More...
 
Vector< D > getVel (const double t) const override
 Gets velocity at a certain time. More...
 
Vector< D > getAcc (const double t) const override
 Gets acceleration of the function at a certain time. More...
 
- Public Member Functions inherited from hermite::BaseInterpol< D >
virtual ~BaseInterpol ()=default
 Destructor.
 
virtual Vector< D > operator() (const double t) const
 Gets value of the interpolation function at a certain point. More...
 

Detailed Description

template<std::size_t D>
class hermite::HermiteUnit< D >

Interpolates on the unit interval.

Calculates one Hermite spline section on the unit interval [0, 1] given a starting point and velocity at time t=0 and an ending point and velocity at t=tf.

The template represents the number of dimensions to calculate in. For example, for 2 dimensions, the position and velocity functions will output a 2D vector.

Constructor & Destructor Documentation

◆ HermiteUnit() [1/2]

template<std::size_t D>
hermite::HermiteUnit< D >::HermiteUnit ( )
default

Default constructor.

Initializing a unit Hermite interpolation curve with the default constructor creates a curve that is a constant 0.

◆ HermiteUnit() [2/2]

template<std::size_t D>
hermite::HermiteUnit< D >::HermiteUnit ( const Vector< D >  p0,
const Vector< D >  p1,
const Vector< D >  v0,
const Vector< D >  v1 
)
inline

Constructor.

Parameters
p0Initial position vector
p1Final position vector
v0Initial velocity vector
v1Final velocity vector

Member Function Documentation

◆ getAcc()

template<std::size_t D>
Vector<D> hermite::HermiteUnit< D >::getAcc ( const double  t) const
inlineoverridevirtual

Gets acceleration of the function at a certain time.

Note
If t is outside of [0, 1], then it still calculates the vector at that time.
Parameters
tTime
Returns
Acceleration

Implements hermite::BaseInterpol< D >.

◆ getPos()

template<std::size_t D>
Vector<D> hermite::HermiteUnit< D >::getPos ( const double  t) const
inlineoverridevirtual

Gets position at a certain time.

Same as calling operator()()

Note
If t is outside of [0, 1], then it still calculates the vector at that time.
Parameters
tTime
Returns
Position

Implements hermite::BaseInterpol< D >.

◆ getVel()

template<std::size_t D>
Vector<D> hermite::HermiteUnit< D >::getVel ( const double  t) const
inlineoverridevirtual

Gets velocity at a certain time.

Note
If t is outside of [0, 1], then it still calculates the vector at that time.
Parameters
tTime
Returns
Velocity

Implements hermite::BaseInterpol< D >.


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