AGX Dynamics  2.35.0.1
agxCollide::Polynomial< N > Class Template Reference

#include <Polynomial.h>

Public Member Functions

 Polynomial (const agx::StackArray< agx::Real, N > &coefficients)
 Constructor: creates a Polynomial with given coefficients. More...
 
Polynomial< N-1 > derive () const
 Calculates derivation of a polygon. More...
 
agx::Real evaluateAt (const agx::Real x) const
 Evaluates polynomial given by polyCoefficients at value x. More...
 
void findRealRootsInInterval (const agx::Real intervalStart, const agx::Real intervalEnd, agx::StackArray< agx::Real, 1 > &roots) const
 
void findRealRootsInInterval (const agx::Real intervalStart, const agx::Real intervalEnd, agx::StackArray< agx::Real, N - 1 > &roots) const
 Calculates agx::Real roots of a single variable polynomial within a given boundary. More...
 

Static Public Member Functions

static void findRootsOfLinearInInterval (const agx::Real a, const agx::Real b, const agx::Real intervalStart, const agx::Real intervalEnd, agx::StackArray< agx::Real, 1 > &root)
 Solves linear function ax + b = 0; returns only agx::Real solutions within given interval Assume it has not been called with all coefficients == 0. More...
 
static void findRootsOfQuadraticInInterval (const agx::Real a, const agx::Real b, const agx::Real c, const agx::Real intervalStart, const agx::Real intervalEnd, agx::StackArray< agx::Real, 2 > &roots)
 Solves quadratic function a x^2 + bx + c, returns only agx::Real solutions within time interval. More...
 

Detailed Description

template<size_t N>
class agxCollide::Polynomial< N >

Definition at line 28 of file Polynomial.h.

Constructor & Destructor Documentation

◆ Polynomial()

template<size_t N>
agxCollide::Polynomial< N >::Polynomial ( const agx::StackArray< agx::Real, N > &  coefficients)
inline

Constructor: creates a Polynomial with given coefficients.

Implementations.

Parameters
coefficientsCoefficients given in decreasing degree

Definition at line 81 of file Polynomial.h.

Member Function Documentation

◆ derive()

template<size_t N>
Polynomial< N - 1 > agxCollide::Polynomial< N >::derive

Calculates derivation of a polygon.

Definition at line 202 of file Polynomial.h.

◆ evaluateAt()

template<size_t N>
agx::Real agxCollide::Polynomial< N >::evaluateAt ( const agx::Real  x) const

Evaluates polynomial given by polyCoefficients at value x.

Definition at line 214 of file Polynomial.h.

◆ findRealRootsInInterval() [1/2]

void agxCollide::Polynomial< size_t(2)>::findRealRootsInInterval ( const agx::Real  intervalStart,
const agx::Real  intervalEnd,
agx::StackArray< agx::Real, 1 > &  roots 
) const
inline

Definition at line 86 of file Polynomial.h.

◆ findRealRootsInInterval() [2/2]

template<size_t N>
void agxCollide::Polynomial< N >::findRealRootsInInterval ( const agx::Real  intervalStart,
const agx::Real  intervalEnd,
agx::StackArray< agx::Real, N - 1 > &  roots 
) const

Calculates agx::Real roots of a single variable polynomial within a given boundary.

Parameters
intervalStartstart of search interval
intervalEndend of search interval
rootsReturns the found roots within interval, in increasing order. Multiple roots are only give once.

Definition at line 109 of file Polynomial.h.

References agx::absolute(), agx::clamp(), agx::equalsZero(), agx::equivalent(), agx::geq(), agx::min(), agx::StackArray< T, N >::push_back(), agx::REAL_SQRT_EPSILON, agx::sign(), and agx::StackArray< T, N >::size().

◆ findRootsOfLinearInInterval()

template<size_t N>
void agxCollide::Polynomial< N >::findRootsOfLinearInInterval ( const agx::Real  a,
const agx::Real  b,
const agx::Real  intervalStart,
const agx::Real  intervalEnd,
agx::StackArray< agx::Real, 1 > &  root 
)
static

Solves linear function ax + b = 0; returns only agx::Real solutions within given interval Assume it has not been called with all coefficients == 0.

Definition at line 226 of file Polynomial.h.

References agx::equalsZero(), and agx::root().

◆ findRootsOfQuadraticInInterval()

template<size_t N>
void agxCollide::Polynomial< N >::findRootsOfQuadraticInInterval ( const agx::Real  a,
const agx::Real  b,
const agx::Real  c,
const agx::Real  intervalStart,
const agx::Real  intervalEnd,
agx::StackArray< agx::Real, 2 > &  roots 
)
static

Solves quadratic function a x^2 + bx + c, returns only agx::Real solutions within time interval.

Assume it has not been called with all coefficients == 0

Definition at line 243 of file Polynomial.h.

References agx::equalsZero(), and agx::StackArray< T, N >::push_back().


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