opensurgsim
Public Member Functions | List of all members
SurgSim::Math::LinearMotionND< T, N > Class Template Reference

LinearMotionND<T, N> defines the concept of a group of linear motions and provides operations on them including arithmetic operations, construction, and I/O. More...

#include <LinearMotionArithmetic.h>

Public Member Functions

 LinearMotionND ()
 Constructor.
 
 LinearMotionND (const std::array< LinearMotion< T >, N > &x)
 Constructor. More...
 
 LinearMotionND (const LinearMotionND< T, N > &motion)
 Copy constructor. More...
 
 LinearMotionND (LinearMotionND< T, N > &&motion)
 Move constructor. More...
 
 LinearMotionND (const std::array< T, N > &a, const std::array< T, N > &b)
 Constructor. More...
 
LinearMotionND< T, N > & operator= (const LinearMotionND< T, N > &motion)
 Assignment operator. More...
 
LinearMotionND< T, N > & operator= (LinearMotionND< T, N > &&motion)
 Move assignment operator. More...
 
IntervalND< T, N > toInterval () const
 Convert from LinearMotion to an Interval. More...
 
bool isApprox (const LinearMotionND< T, N > &motion, const T &epsilon) const
 
bool operator== (const LinearMotionND< T, N > &motion) const
 
bool operator!= (const LinearMotionND< T, N > &motion) const
 
IntervalND< T, N > operator* (const LinearMotionND< T, N > &m) const
 Standard arithmetic operators extended to interval groups. More...
 
IntervalND< T, N > operator/ (const LinearMotionND< T, N > &m) const
 Standard arithmetic operators extended to interval groups. More...
 
Interval< T > dotProduct (const LinearMotionND< T, N > &motion) const
 
const LinearMotion< T > & getAxis (int i) const
 
void getStart (std::array< T, N > *start) const
 
void getEnd (std::array< T, N > *end) const
 
LinearMotionND< T, N > firstHalf () const
 
LinearMotionND< T, N > secondHalf () const
 
LinearMotionND< T, N > operator+ (const LinearMotionND< T, N > &m) const
 
LinearMotionND< T, N > & operator+= (const LinearMotionND< T, N > &m)
 
LinearMotionND< T, N > operator- (const LinearMotionND< T, N > &m) const
 
LinearMotionND< T, N > & operator-= (const LinearMotionND< T, N > &m)
 

Detailed Description

template<class T, int N>
class SurgSim::Math::LinearMotionND< T, N >

LinearMotionND<T, N> defines the concept of a group of linear motions and provides operations on them including arithmetic operations, construction, and I/O.

Template Parameters
Tunderlying data type over which the linear motion is defined.
NDimensionality of the interval
See also
LinearMotionND<T> and IntervalArthmetic<T, N>

Constructor & Destructor Documentation

§ LinearMotionND() [1/4]

template<typename T, int N>
SurgSim::Math::LinearMotionND< T, N >::LinearMotionND ( const std::array< LinearMotion< T >, N > &  x)
explicit

Constructor.

Parameters
xarray of N motions to be copied into the group

§ LinearMotionND() [2/4]

template<typename T, int N>
SurgSim::Math::LinearMotionND< T, N >::LinearMotionND ( const LinearMotionND< T, N > &  motion)

Copy constructor.

Parameters
motionmotion group to copied

§ LinearMotionND() [3/4]

template<typename T, int N>
SurgSim::Math::LinearMotionND< T, N >::LinearMotionND ( LinearMotionND< T, N > &&  motion)

Move constructor.

Parameters
motionmotion to be copied

§ LinearMotionND() [4/4]

template<typename T, int N>
SurgSim::Math::LinearMotionND< T, N >::LinearMotionND ( const std::array< T, N > &  a,
const std::array< T, N > &  b 
)

Constructor.

Parameters
aarray of N values to be used as the respective starts for the linear motion entries.
barray of N values to be used as the respective ends for the linear motion entries.

Member Function Documentation

§ dotProduct()

template<typename T, int N>
Interval< T > SurgSim::Math::LinearMotionND< T, N >::dotProduct ( const LinearMotionND< T, N > &  motion) const
Parameters
motionthe input linear motion group
Returns
the interval dot product of the current group and interval

§ firstHalf()

template<typename T , int N>
LinearMotionND< T, N > SurgSim::Math::LinearMotionND< T, N >::firstHalf ( ) const
Returns
the linear motion from the starting point to the midpoint

§ getAxis()

template<typename T , int N>
const LinearMotion< T > & SurgSim::Math::LinearMotionND< T, N >::getAxis ( int  i) const
Parameters
ithe selector for the linear motion to be returned
Returns
the ith interval in the current group
Exceptions
thrownif the requested axis is < 0 or greater than N - 1

§ getEnd()

template<typename T, int N>
void SurgSim::Math::LinearMotionND< T, N >::getEnd ( std::array< T, N > *  end) const
Parameters
end[out] the ending points of the linear motion group as an N dimension array.

§ getStart()

template<typename T, int N>
void SurgSim::Math::LinearMotionND< T, N >::getStart ( std::array< T, N > *  start) const
Parameters
start[out] the starting points of the linear motion group as an N dimension array.

§ isApprox()

template<typename T, int N>
bool SurgSim::Math::LinearMotionND< T, N >::isApprox ( const LinearMotionND< T, N > &  motion,
const T &  epsilon 
) const
Parameters
motionthe linear motion group to be tested
epsilonthe nearness parameter
Returns
true if each linear motion in the input group is approximately equal to its correspondent element in motion.

§ operator!=()

template<typename T, int N>
bool SurgSim::Math::LinearMotionND< T, N >::operator!= ( const LinearMotionND< T, N > &  motion) const
Parameters
motionthe linear motion group to be tested
Returns
true if the current linear motion group is not identical to the input group

§ operator*()

template<typename T, int N>
IntervalND< T, N > SurgSim::Math::LinearMotionND< T, N >::operator* ( const LinearMotionND< T, N > &  m) const

Standard arithmetic operators extended to interval groups.

Note
Multiplication and division operators by their nature do not preserve time ordering and so the return value is an IntervalND instead of a LinearMotionND

§ operator+()

template<typename T, int N>
LinearMotionND< T, N > SurgSim::Math::LinearMotionND< T, N >::operator+ ( const LinearMotionND< T, N > &  m) const

Standard arithmetic operators extended to interval groups

§ operator/()

template<typename T, int N>
IntervalND< T, N > SurgSim::Math::LinearMotionND< T, N >::operator/ ( const LinearMotionND< T, N > &  m) const

Standard arithmetic operators extended to interval groups.

Note
Multiplication and division operators by their nature do not preserve time ordering and so the return value is an IntervalND instead of a LinearMotionND
Exceptions
ifany component of interval includes 0

§ operator=() [1/2]

template<typename T, int N>
LinearMotionND< T, N > & SurgSim::Math::LinearMotionND< T, N >::operator= ( const LinearMotionND< T, N > &  motion)

Assignment operator.

Parameters
motionLinear motion group to be copied

§ operator=() [2/2]

template<typename T, int N>
LinearMotionND< T, N > & SurgSim::Math::LinearMotionND< T, N >::operator= ( LinearMotionND< T, N > &&  motion)

Move assignment operator.

Parameters
motionLinear motion group to be moved

§ operator==()

template<typename T, int N>
bool SurgSim::Math::LinearMotionND< T, N >::operator== ( const LinearMotionND< T, N > &  motion) const
Parameters
motionthe linear motion group to be tested
Returns
true if the current linear motion group is identical to the input group

§ secondHalf()

template<typename T , int N>
LinearMotionND< T, N > SurgSim::Math::LinearMotionND< T, N >::secondHalf ( ) const
Returns
the linear motion from the midpoint to the ending point

§ toInterval()

template<typename T , int N>
IntervalND< T, N > SurgSim::Math::LinearMotionND< T, N >::toInterval ( ) const

Convert from LinearMotion to an Interval.

Returns
the conversion of the ND LinearMotion to an ND Interval

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