CARLA
Public Types | Public Member Functions | Private Attributes | Friends | List of all members
carla::geom::CubicPolynomial Class Reference

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

#include <CubicPolynomial.h>

+ Collaboration diagram for carla::geom::CubicPolynomial:

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. More...
 
value_type GetA () const
 
value_type GetB () const
 
value_type GetC () const
 
value_type GetD () const
 
value_type GetS () const
 
CubicPolynomialoperator*= (const value_type &rhs)
 
CubicPolynomialoperator+= (const CubicPolynomial &rhs)
 
void Set (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)
 
value_type Tangent (const value_type &x) const
 Evaluates the tangent using df/dx = b + 2cx + 3dx^2. More...
 

Private Attributes

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

Friends

CubicPolynomial operator* (CubicPolynomial lhs, const value_type &rhs)
 
CubicPolynomial operator* (const value_type &lhs, CubicPolynomial 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

◆ 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 _s.

◆ 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 _s.

Member Function Documentation

◆ Evaluate()

value_type carla::geom::CubicPolynomial::Evaluate ( const value_type x) const
inline

Evaluates f(x) = a + bx + cx^2 + dx^3.

Definition at line 106 of file CubicPolynomial.h.

References _v.

Referenced by carla::road::element::RoadInfoElevation::Evaluate(), and carla::road::Map::GetWaypoint().

+ Here is the caller graph for this function:

◆ 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.

◆ operator+=()

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

Definition at line 120 of file CubicPolynomial.h.

References _v.

◆ Set() [1/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

Definition at line 79 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 
)
inline

Definition at line 92 of file CubicPolynomial.h.

References _s, and _v.

◆ Tangent()

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

Evaluates the tangent using df/dx = b + 2cx + 3dx^2.

Definition at line 112 of file CubicPolynomial.h.

References _v.

Referenced by carla::road::element::RoadInfoElevation::Evaluate().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator* [1/2]

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

Definition at line 139 of file CubicPolynomial.h.

◆ operator* [2/2]

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

Definition at line 144 of file CubicPolynomial.h.

◆ operator+

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

Definition at line 127 of file CubicPolynomial.h.

Member Data Documentation

◆ _s

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

Definition at line 162 of file CubicPolynomial.h.

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

◆ _v

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

Definition at line 159 of file CubicPolynomial.h.

Referenced by Evaluate(), GetA(), GetB(), GetC(), GetD(), operator*=(), operator+=(), Set(), and Tangent().


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