Class QuarticPolynomial

Class Documentation

class QuarticPolynomial

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

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

Public Functions

QuarticPolynomial(float xs, float vxs, float xe, float vxe, float axe, float time)

Constructor for QuarticPolynomial.

Parameters:
  • xs – Initial position.

  • vxs – Initial velocity.

  • axs – Initial acceleration.

  • vxe – Final velocity.

  • axe – Final acceleration.

  • time – Duration over which the polynomial is defined.

inline float calc_point(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(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(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(float t) 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(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
float a_4