45 : _v{ {a - b * s + c * s * s - d * s * s * s,
46 b - 2 * c * s + 3 * d * s * s,
85 _v = { a - b * s + c * s * s - d * s * s * s,
86 b - 2 * c * s + 3 * d * s * s,
108 return _v[0] + x * (_v[1] + x * (_v[2] + x * _v[3]));
113 return _v[1] + x * (2 * _v[2] + x * 3 * _v[3]);
121 for (
auto i = 0u; i < _v.size(); ++i) {
133 for (
auto i = 0u; i < _v.size(); ++i) {
159 std::array<value_type, 4> _v = {0.0, 0.0, 0.0, 0.0};
Describes a Cubic Polynomial so: f(x) = a + bx + cx^2 + dx^3
CubicPolynomial & operator*=(const value_type &rhs)
CubicPolynomial & operator+=(const CubicPolynomial &rhs)
CubicPolynomial(const value_type &a, const value_type &b, const value_type &c, const value_type &d, const value_type &s)
void Set(const value_type &a, const value_type &b, const value_type &c, const value_type &d)
CubicPolynomial()=default
friend CubicPolynomial operator*(const value_type &lhs, CubicPolynomial rhs)
value_type Evaluate(const value_type &x) const
Evaluates f(x) = a + bx + cx^2 + dx^3
value_type Tangent(const value_type &x) const
Evaluates the tangent using df/dx = b + 2cx + 3dx^2
void Set(const value_type &a, const value_type &b, const value_type &c, const value_type &d, const value_type &s)
friend CubicPolynomial operator+(CubicPolynomial lhs, const CubicPolynomial &rhs)
friend CubicPolynomial operator*(CubicPolynomial lhs, const value_type &rhs)
CubicPolynomial(const value_type &a, const value_type &b, const value_type &c, const value_type &d)
CubicPolynomial(const CubicPolynomial &)=default
std::array< value_type, 4 > _v
This file contains definitions of common data structures used in traffic manager.