CARLA
Loading...
Searching...
No Matches
carla::geom::CubicPolynomial Class Reference

Describes a Cubic Polynomial so: f(x) = a + bx + cx^2 + dx^3. More...

#include <CubicPolynomial.h>

Public Types

using value_type = double

Public Member Functions

 CubicPolynomial ()=default
 CubicPolynomial (const CubicPolynomial &)=default
 CubicPolynomial (const value_type &a, const value_type &b, const value_type &c, const value_type &d)
 CubicPolynomial (const value_type &a, const value_type &b, const value_type &c, const value_type &d, const value_type &s)
value_type Evaluate (const value_type &x) const
 Evaluates f(x) = a + bx + cx^2 + dx^3.
value_type GetA () const
value_type GetB () const
value_type GetC () const
value_type GetD () const
value_type GetS () const
CubicPolynomial & operator*= (const value_type &rhs)
CubicPolynomial & operator+= (const CubicPolynomial &rhs)
void Set (const value_type &a, const value_type &b, const value_type &c, const value_type &d)
void Set (const value_type &a, const value_type &b, const value_type &c, const value_type &d, const value_type &s)
value_type Tangent (const value_type &x) const
 Evaluates the tangent using df/dx = b + 2cx + 3dx^2.

Private Attributes

value_type _s
std::array< value_type, 4 > _v = {0.0, 0.0, 0.0, 0.0}

Friends

CubicPolynomial operator* (const value_type &lhs, CubicPolynomial rhs)
CubicPolynomial operator* (CubicPolynomial lhs, const value_type &rhs)
CubicPolynomial operator+ (CubicPolynomial lhs, const CubicPolynomial &rhs)

Detailed Description

Describes a Cubic Polynomial so: f(x) = a + bx + cx^2 + dx^3.

Definition at line 18 of file CubicPolynomial.h.

Member Typedef Documentation

◆ value_type

Definition at line 21 of file CubicPolynomial.h.

Constructor & Destructor Documentation

◆ CubicPolynomial() [1/4]

carla::geom::CubicPolynomial::CubicPolynomial ( )
default

◆ CubicPolynomial() [2/4]

carla::geom::CubicPolynomial::CubicPolynomial ( const CubicPolynomial & )
default

References CubicPolynomial().

◆ CubicPolynomial() [3/4]

carla::geom::CubicPolynomial::CubicPolynomial ( const value_type & a,
const value_type & b,
const value_type & c,
const value_type & d )
inline

Definition at line 31 of file CubicPolynomial.h.

References _v.

◆ CubicPolynomial() [4/4]

carla::geom::CubicPolynomial::CubicPolynomial ( const value_type & a,
const value_type & b,
const value_type & c,
const value_type & d,
const value_type & s )
inline

Definition at line 39 of file CubicPolynomial.h.

References _v.

Member Function Documentation

◆ Evaluate()

◆ GetA()

value_type carla::geom::CubicPolynomial::GetA ( ) const
inline

Definition at line 55 of file CubicPolynomial.h.

References _v.

◆ GetB()

value_type carla::geom::CubicPolynomial::GetB ( ) const
inline

Definition at line 59 of file CubicPolynomial.h.

References _v.

◆ GetC()

value_type carla::geom::CubicPolynomial::GetC ( ) const
inline

Definition at line 63 of file CubicPolynomial.h.

References _v.

◆ GetD()

value_type carla::geom::CubicPolynomial::GetD ( ) const
inline

Definition at line 67 of file CubicPolynomial.h.

References _v.

◆ GetS()

value_type carla::geom::CubicPolynomial::GetS ( ) const
inline

Definition at line 71 of file CubicPolynomial.h.

References _s.

◆ operator*=()

CubicPolynomial & carla::geom::CubicPolynomial::operator*= ( const value_type & rhs)
inline

Definition at line 132 of file CubicPolynomial.h.

References _v, and CubicPolynomial().

◆ operator+=()

CubicPolynomial & carla::geom::CubicPolynomial::operator+= ( const CubicPolynomial & rhs)
inline

Definition at line 120 of file CubicPolynomial.h.

References _v, and CubicPolynomial().

◆ Set() [1/2]

void carla::geom::CubicPolynomial::Set ( const value_type & a,
const value_type & b,
const value_type & c,
const value_type & d )
inline

Definition at line 92 of file CubicPolynomial.h.

References _s, and _v.

◆ Set() [2/2]

void carla::geom::CubicPolynomial::Set ( const value_type & a,
const value_type & b,
const value_type & c,
const value_type & d,
const value_type & s )
inline

◆ Tangent()

value_type carla::geom::CubicPolynomial::Tangent ( const value_type & x) const
inline

◆ operator* [1/2]

CubicPolynomial operator* ( const value_type & lhs,
CubicPolynomial rhs )
friend

Definition at line 144 of file CubicPolynomial.h.

References CubicPolynomial().

◆ operator* [2/2]

CubicPolynomial operator* ( CubicPolynomial lhs,
const value_type & rhs )
friend

Definition at line 139 of file CubicPolynomial.h.

References CubicPolynomial().

◆ operator+

CubicPolynomial operator+ ( CubicPolynomial lhs,
const CubicPolynomial & rhs )
friend

Definition at line 127 of file CubicPolynomial.h.

References CubicPolynomial().

Member Data Documentation

◆ _s

value_type carla::geom::CubicPolynomial::_s
private

Definition at line 162 of file CubicPolynomial.h.

Referenced by GetS(), Set(), and Set().

◆ _v

std::array<value_type, 4> carla::geom::CubicPolynomial::_v = {0.0, 0.0, 0.0, 0.0}
private

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