opensurgsim
|
LinearMotion is (intentionally) a lot like Interval, but it deals with linear motion where all operands start and end their motion simultaneously. More...
#include <LinearMotionArithmetic.h>
Public Member Functions | |
LinearMotion () | |
Constructor. | |
LinearMotion (const T &start, const T &end) | |
Constructor. More... | |
LinearMotion (const LinearMotion< T > &m) | |
Copy constructor. More... | |
LinearMotion (LinearMotion< T > &&m) | |
Move constructor. More... | |
LinearMotion< T > & | operator= (const LinearMotion< T > &m) |
Assignment operator. More... | |
LinearMotion< T > & | operator= (LinearMotion< T > &&m) |
Move assignment operator. More... | |
Interval< T > | toInterval () const |
Convert from LinearMotion to an Interval. More... | |
Polynomial< T, 1 > | toPolynomial () const |
Returns a linear expression (degree-1 polynomial) whose value for t=0..1 progresses from `start' to `end'. More... | |
bool | containsZero () const |
bool | isApprox (const LinearMotion< T > &i, const T &epsilon) const |
bool | operator== (const LinearMotion< T > &m) const |
bool | operator!= (const LinearMotion< T > &m) const |
Interval< T > | operator* (const LinearMotion< T > &m) const |
Standard arithmetic operators extended to interval groups. More... | |
Interval< T > | operator/ (const LinearMotion< T > &m) const |
Standard arithmetic operators extended to interval groups. More... | |
T | getStart () const |
T | getEnd () const |
T | atTime (const T &t) const |
LinearMotion< T > | firstHalf () const |
LinearMotion< T > | secondHalf () const |
LinearMotion< T > | operator+ (const LinearMotion< T > &m) const |
LinearMotion< T > & | operator+= (const LinearMotion< T > &m) |
LinearMotion< T > | operator- (const LinearMotion< T > &m) const |
LinearMotion< T > & | operator-= (const LinearMotion< T > &m) |
LinearMotion is (intentionally) a lot like Interval, but it deals with linear motion where all operands start and end their motion simultaneously.
LinearMotion results in much tighter bounds compared to Interval, since Interval must consider any value of each operand, and LinearMotion only considers values that are synchronous with one another.
The bounds of a LinearMotion are a start value and an end value; there's no requirement that start <= end (or vice versa).
Many operations on LinearMotion arguments (*, /) return results that are not linear in time, so those operations will return Interval instead.
T | underlying data type over which the linear motion is defined. |
SurgSim::Math::LinearMotion< T >::LinearMotion | ( | const T & | start, |
const T & | end | ||
) |
Constructor.
start | initial value of the constructed linear motion |
end | final value of the constructed linear motion |
if | max is less than min |
SurgSim::Math::LinearMotion< T >::LinearMotion | ( | const LinearMotion< T > & | m | ) |
Copy constructor.
m | Interval to be copied |
SurgSim::Math::LinearMotion< T >::LinearMotion | ( | LinearMotion< T > && | m | ) |
Move constructor.
m | LinearMotion to be copied |
T SurgSim::Math::LinearMotion< T >::atTime | ( | const T & | t | ) | const |
t | the parametric time at which to evaluate the linear motion |
bool SurgSim::Math::LinearMotion< T >::containsZero | ( | ) | const |
LinearMotion< T > SurgSim::Math::LinearMotion< T >::firstHalf | ( | ) | const |
T SurgSim::Math::LinearMotion< T >::getEnd | ( | ) | const |
T SurgSim::Math::LinearMotion< T >::getStart | ( | ) | const |
bool SurgSim::Math::LinearMotion< T >::isApprox | ( | const LinearMotion< T > & | i, |
const T & | epsilon | ||
) | const |
i | the linear motion to be tested |
epsilon | the nearness parameter |
bool SurgSim::Math::LinearMotion< T >::operator!= | ( | const LinearMotion< T > & | m | ) | const |
m | the linear motion to be tested |
Interval< T > SurgSim::Math::LinearMotion< T >::operator* | ( | const LinearMotion< T > & | m | ) | const |
Standard arithmetic operators extended to interval groups.
LinearMotion< T > SurgSim::Math::LinearMotion< T >::operator+ | ( | const LinearMotion< T > & | m | ) | const |
Standard arithmetic operators extended to linear motions
Interval< T > SurgSim::Math::LinearMotion< T >::operator/ | ( | const LinearMotion< T > & | m | ) | const |
Standard arithmetic operators extended to interval groups.
if | any component of interval includes 0 |
LinearMotion< T > & SurgSim::Math::LinearMotion< T >::operator= | ( | const LinearMotion< T > & | m | ) |
Assignment operator.
m | Interval to be copied |
LinearMotion< T > & SurgSim::Math::LinearMotion< T >::operator= | ( | LinearMotion< T > && | m | ) |
Move assignment operator.
m | Interval to be moved |
bool SurgSim::Math::LinearMotion< T >::operator== | ( | const LinearMotion< T > & | m | ) | const |
m | the linear motion to be tested |
LinearMotion< T > SurgSim::Math::LinearMotion< T >::secondHalf | ( | ) | const |
Interval< T > SurgSim::Math::LinearMotion< T >::toInterval | ( | ) | const |
Convert from LinearMotion to an Interval.
Polynomial< T, 1 > SurgSim::Math::LinearMotion< T >::toPolynomial | ( | ) | const |
Returns a linear expression (degree-1 polynomial) whose value for t=0..1 progresses from `start' to `end'.