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 <SurgSim/Math/LinearMotionArithmetic.h>`

## Public Member Functions

| LinearMotionND ()
| Constructor. More...
| 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)

## Private Attributes

std::array< LinearMotion< T >, N > | m_motion
| The N dimensional group of linear motions. More...

## 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

  T | underlying data type over which the linear motion is defined.
  N | Dimensionality of the interval

See also
  LinearMotionND<T> and IntervalArthmetic<T, N>

## Constructor & Destructor Documentation

## LinearMotionND() [1/5]

template<typename T , int N>

SurgSim::Math::LinearMotionND< T, N >::LinearMotionND | ( |  | ) |

Constructor.

## LinearMotionND() [2/5]

template<typename T, int N>

SurgSim::Math::LinearMotionND< T, N >::LinearMotionND | ( | const std::array< LinearMotion< T >, N > & | x | ) |

explicit

Constructor.

Parameters

  x | array of N motions to be copied into the group

## LinearMotionND() [3/5]

template<typename T, int N>

SurgSim::Math::LinearMotionND< T, N >::LinearMotionND | ( | const LinearMotionND< T, N > & | motion | ) |

Copy constructor.

Parameters

  motion | motion group to copied

## LinearMotionND() [4/5]

template<typename T, int N>

SurgSim::Math::LinearMotionND< T, N >::LinearMotionND | ( | LinearMotionND< T, N > && | motion | ) |

Move constructor.

Parameters

  motion | motion to be copied

## LinearMotionND() [5/5]

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

  a | array of N values to be used as the respective starts for the linear motion entries.
  b | array 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

  motion | the 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

  i | the selector for the linear motion to be returned

Returns
  the ith interval in the current group

Exceptions

  thrown | if 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

  motion | the linear motion group to be tested
  epsilon | the 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

  motion | the 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>

LinearMotionND< T, N > & SurgSim::Math::LinearMotionND< T, N >::operator+= | ( | const LinearMotionND< T, N > & | m | ) |

Standard arithmetic operators extended to interval groups

## 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>

LinearMotionND< T, N > & SurgSim::Math::LinearMotionND< T, N >::operator-= | ( | const LinearMotionND< T, N > & | m | ) |

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

  if | any 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

  motion | Linear 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

  motion | Linear 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

  motion | the 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

## Member Data Documentation

## m_motion

template<class T, int N>

std::array<LinearMotion<T>, N> SurgSim::Math::LinearMotionND< T, N >::m_motion

private

The N dimensional group of linear motions.

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

- SurgSim/Math/LinearMotionArithmetic.h
- SurgSim/Math/LinearMotionArithmetic-inl.h