Class ThirdPolynomial

Class Documentation

class ThirdPolynomial

Represents a cubic polynomial defined by its initial position, final position, final velocity, final acceleration, and time duration.

Public Functions

ThirdPolynomial(const float &xs, const float &xe, const float &vxe, const float &axe, const float &time)

Constructor for third_polynomial.

Parameters:
  • xs – Initial position.

  • xe – Final position.

  • vxe – Final velocity.

  • axe – Final acceleration.

  • time – Duration over which the polynomial is defined.

inline float calc_point(const float &t) const

Calculates the value of the polynomial at a given time.

Parameters:

t – Time at which to evaluate the polynomial.

Returns:

Value of the polynomial at time t.

inline float calc_first_derivative(const float &t) const

Calculates the derivative of the polynomial at a given time.

Parameters:

t – Time at which to evaluate the polynomial.

Returns:

Derivative of the polynomial at time t.

inline float calc_second_derivative(const float &t) const

Calculates the second derivative of the polynomial at a given time.

Parameters:

t – Time at which to evaluate the polynomial.

Returns:

Second derivative of the polynomial at time t.

inline float calc_third_derivative() const

Calculates the third derivative of the polynomial at a given time.

Parameters:

t – Time at which to evaluate the polynomial.

Returns:

Third derivative of the polynomial at time t.

inline std::tuple<float, float, float, float> calc_all(const float &t) const

Calculates the value, first derivative, second derivative, and third derivative of the polynomial at a given time.

Parameters:

t – Time at which to evaluate the polynomial.

Returns:

A tuple containing the value, first derivative, second derivative, and third derivative of the polynomial at time t.

Public Members

float a_0
float a_1
float a_2
float a_3