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};
void Set(const value_type &a, const value_type &b, const value_type &c, const value_type &d)
Describes a Cubic Polynomial so: f(x) = a + bx + cx^2 + dx^3.
CubicPolynomial()=default
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*(const value_type &lhs, CubicPolynomial rhs)
This file contains definitions of common data structures used in traffic manager. ...
CubicPolynomial(const value_type &a, const value_type &b, const value_type &c, const value_type &d)
value_type Evaluate(const value_type &x) const
Evaluates f(x) = a + bx + cx^2 + dx^3.
friend CubicPolynomial operator*(CubicPolynomial lhs, const value_type &rhs)
value_type Tangent(const value_type &x) const
Evaluates the tangent using df/dx = b + 2cx + 3dx^2.
CubicPolynomial & operator+=(const CubicPolynomial &rhs)
CubicPolynomial & operator*=(const value_type &rhs)
CubicPolynomial(const value_type &a, const value_type &b, const value_type &c, const value_type &d, const value_type &s)
std::array< value_type, 4 > _v
friend CubicPolynomial operator+(CubicPolynomial lhs, const CubicPolynomial &rhs)