SurgSim::Math::LinearMotionND< T, 3 > Class Template Reference

LinearMotionND<T, 3> specializes the LinearMotionND<T, N> class for 3 dimensions. More...

`#include <SurgSim/Math/LinearMotionArithmetic.h>`

## Public Types

typedef Eigen::Matrix< T, 3, 1 > | Vector3
| Typedef for a vector 3 return. More...

## Public Member Functions

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

## Private Attributes

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

## Detailed Description

### template<class T>
class SurgSim::Math::LinearMotionND< T, 3 >

LinearMotionND<T, 3> specializes the LinearMotionND<T, N> class for 3 dimensions.

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

## Member Typedef Documentation

## Vector3

template<class T >

typedef Eigen::Matrix<T, 3, 1> SurgSim::Math::LinearMotionND< T, 3 >::Vector3

Typedef for a vector 3 return.

## Constructor & Destructor Documentation

## LinearMotionND() [1/7]

template<typename T >

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

Constructor.

## LinearMotionND() [2/7]

template<typename T >

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

explicit

Constructor.

Parameters

  x | array of 3 linear motions to be copied into the group

## LinearMotionND() [3/7]

template<typename T >

SurgSim::Math::LinearMotionND< T, 3 >::LinearMotionND | ( | const LinearMotion< T > & | a,
|  | const LinearMotion< T > & | b,
|  | const LinearMotion< T > & | c
| ) |  |

Constructor.

Parameters

  a | first linear motion to be added to the 3 group
  b | second linear motion to be added to the 3 group
  c | third linear motion to be added to the 3 group

## LinearMotionND() [4/7]

template<typename T >

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

Copy constructor.

Parameters

  motion | linear motion 3 group to be copied

## LinearMotionND() [5/7]

template<typename T >

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

Move constructor.

Parameters

  motion | Linear motion to be copied

## LinearMotionND() [6/7]

template<typename T >

SurgSim::Math::LinearMotionND< T, 3 >::LinearMotionND | ( | const std::array< T, 3 > & | start,
|  | const std::array< T, 3 > & | end
| ) |  |

Constructor.

Parameters

  start | array of 3 values to be used as the respective starts for the linear motion entries.
  end | array of 3 values to be used as the respective ends for the linear motion entries.

## LinearMotionND() [7/7]

template<typename T >

SurgSim::Math::LinearMotionND< T, 3 >::LinearMotionND | ( | const Vector3 & | start,
|  | const Vector3 & | end
| ) |  |

Constructor.

Parameters

  start | array of 3 values to be used as the respective starts for the linear motion entries.
  end | array of 3 values to be used as the respective ends for the linear motion entries.

## Member Function Documentation

## atTime()

template<typename T >

LinearMotionND< T, 3 >::Vector3 SurgSim::Math::LinearMotionND< T, 3 >::atTime | ( | const T & | t | ) | const

Parameters

  t | the parametric value at which to evaluate the linear motion

Returns
  the value of the linear motion 3D at time t as a 3 Vector

## crossProduct()

template<typename T >

IntervalND< T, 3 > SurgSim::Math::LinearMotionND< T, 3 >::crossProduct | ( | const LinearMotionND< T, 3 > & | motion,
|  | const Interval< T > & | range
| ) |  | const

Parameters

  motion | the input linear motion 3 group
  range | the range over which the cross product is to be evaluated.

Returns
  the interval cross product of the current 3 group and interval evaluated over the interval range.

## dotProduct()

template<typename T >

Interval< T > SurgSim::Math::LinearMotionND< T, 3 >::dotProduct | ( | const LinearMotionND< T, 3 > & | motion,
|  | const Interval< T > & | range
| ) |  | const

Parameters

  motion | the input linear motion 3 group
  range | the range over which the dot product is to be evaluated.

Returns
  the interval dot product of the current 3 group and interval evaluated over the interval range.

## firstHalf()

template<typename T >

LinearMotionND< T, 3 > SurgSim::Math::LinearMotionND< T, 3 >::firstHalf | ( |  | ) | const

Returns
  the linear motion 3D from the start to the midpoint

## getAxis()

template<typename T >

const LinearMotion< T > & SurgSim::Math::LinearMotionND< T, 3 >::getAxis | ( | int | i | ) | const

Parameters

  i | the selector for the linear motion to be returned

Returns
  the ith linear motion in the current 3 group

Exceptions

  thrown | if the requested axis is < 0 or greater than 2

## getEnd() [1/2]

template<typename T >

void SurgSim::Math::LinearMotionND< T, 3 >::getEnd | ( | std::array< T, 3 > * | end | ) | const

Parameters

  end | [out] the end of the linear motion 3D as a 3 value array

## getEnd() [2/2]

template<typename T >

LinearMotionND< T, 3 >::Vector3 SurgSim::Math::LinearMotionND< T, 3 >::getEnd | ( |  | ) | const

Returns
  the end of the linear motion 3D as a 3 Vector

## getStart() [1/2]

template<typename T >

void SurgSim::Math::LinearMotionND< T, 3 >::getStart | ( | std::array< T, 3 > * | start | ) | const

Parameters

  start | [out] the start of the linear motion 3D as a 3 value array

## getStart() [2/2]

template<typename T >

LinearMotionND< T, 3 >::Vector3 SurgSim::Math::LinearMotionND< T, 3 >::getStart | ( |  | ) | const

Returns
  the start of the linear motion 3D as a 3 Vector

## isApprox()

template<typename T >

bool SurgSim::Math::LinearMotionND< T, 3 >::isApprox | ( | const LinearMotionND< T, 3 > & | motion,
|  | const T & | epsilon
| ) |  | const

Parameters

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

## magnitude()

template<typename T >

Interval< T > SurgSim::Math::LinearMotionND< T, 3 >::magnitude | ( | const Interval< T > & | range | ) | const

Returns
  the linear motion magnitude for the current 3 group

## magnitudeSquared()

template<typename T >

Interval< T > SurgSim::Math::LinearMotionND< T, 3 >::magnitudeSquared | ( | const Interval< T > & | range | ) | const

Returns
  the square of the linear motion magnitude for the current 3 group

## operator!=()

template<typename T >

bool SurgSim::Math::LinearMotionND< T, 3 >::operator!= | ( | const LinearMotionND< T, 3 > & | motion | ) | const

Parameters

  motion | the linear motion group to be tested

Returns
  true if the current linear motion 3 group is not identical to the input 3 group motion.

## operator*()

template<typename T >

IntervalND< T, 3 > SurgSim::Math::LinearMotionND< T, 3 >::operator* | ( | const LinearMotionND< T, 3 > & | 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 >

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

Standard arithmetic operators extended to 3 interval groups

## operator+=()

template<typename T >

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

Standard arithmetic operators extended to 3 interval groups

## operator-()

template<typename T >

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

Standard arithmetic operators extended to 3 interval groups

## operator-=()

template<typename T >

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

Standard arithmetic operators extended to 3 interval groups

## operator/()

template<typename T >

IntervalND< T, 3 > SurgSim::Math::LinearMotionND< T, 3 >::operator/ | ( | const LinearMotionND< T, 3 > & | 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 >

LinearMotionND< T, 3 > & SurgSim::Math::LinearMotionND< T, 3 >::operator= | ( | const LinearMotionND< T, 3 > & | motion | ) |

Assignment operator.

Parameters

  motion | Linear motion 3 group to be copied

## operator=() [2/2]

template<typename T >

LinearMotionND< T, 3 > & SurgSim::Math::LinearMotionND< T, 3 >::operator= | ( | LinearMotionND< T, 3 > && | motion | ) |

Move assignment operator.

Parameters

  motion | Linear motion 3 group to be moved

## operator==()

template<typename T >

bool SurgSim::Math::LinearMotionND< T, 3 >::operator== | ( | const LinearMotionND< T, 3 > & | motion | ) | const

Parameters

  motion | the linear motion group to be tested

Returns
  true if the current linear motion 3 group is identical to the input 3 group motion

## secondHalf()

template<typename T >

LinearMotionND< T, 3 > SurgSim::Math::LinearMotionND< T, 3 >::secondHalf | ( |  | ) | const

Returns
  the linear motion 3D from the midpoint to the start

## toInterval()

template<typename T >

IntervalND< T, 3 > SurgSim::Math::LinearMotionND< T, 3 >::toInterval | ( |  | ) | const

Convert from LinearMotion to an Interval.

Returns
  the conversion of the 3D LinearMotion to a 3D Interval

## Member Data Documentation

## m_motion

template<class T >

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

private

The 3 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