Public Member Functions
rtc::Rotation< T > Class Template Reference

#include <rtcRotation.h>

Inheritance diagram for rtc::Rotation< T >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void apply (Vec3< T > &v) const
 Helper for applying the rotation to points: Rotation * Vec.
Vec3< T > apply (const Vec3< T > &v) const
 Rotation ()
 Constructor.
 Rotation (const T x11, const T x12, const T x13, const T x21, const T x22, const T x23, const T x31, const T x32, const T x33)
 Rotation (const Mat< T, 3, 3 > &m)
 Rotation (const Quaternion< T > &q)
 Rotation (const EulerAngles< T > &e)
template<class U >
 Rotation (const Mat< U, 3, 3 > &m)
 Casting Operation.
void set (const Quaternion< T > &q)
 Mutators.
void set (const EulerAngles< T > &e)
void set (const T theta, const T phi)

Detailed Description

template<class T>
class rtc::Rotation< T >

The Rotation Matrix Class

Defines rotation matrix class that derives from SMat<T,3> and knows how to construct itself from several other common rotation representations, such as quaternions, axis angles, and euler angles.

A coordinate rotation is a rotation about a single coordinate axis. Enumerating the x-, y-, and z-axes with 1,2, and 3, the coordinate rotations are:

\[ R_{1}=\left[\begin{array}{ccc} 1 & 0 & 0\\ 0 & \cos\left(\phi\right) & -\sin\left(\phi\right)\\ 0 & \sin\left(\phi\right) & \cos\left(\phi\right)\end{array}\right] \]

\[ R_{2}=\left[\begin{array}{ccc} \cos\left(\theta\right) & 0 & \sin\left(\theta\right)\\ 0 & 1 & 0\\ -\sin\left(\theta\right) & 0 & \cos\left(\theta\right)\end{array}\right] \]

\[ R_{3}=\left[\begin{array}{ccc} \cos\left(\psi\right) & -\sin\left(\psi\right) & 0\\ \sin\left(\psi\right) & \cos\left(\psi\right) & 0\\ 0 & 0 & 1\end{array}\right] \]

A matrix representing the end result of all three rotations is formed by successive multiplication of the matrices representing the three simple rotations, as in the equation

\[ R_{3}R_{2}R_{1}=\left[\begin{array}{ccc} \cos\left(\psi\right)\cos\left(\theta\right) & \cos\left(\psi\right)\sin\left(\theta\right)\sin\left(\phi\right)-\sin\left(\psi\right)\cos\left(\phi\right) & \cos\left(\psi\right)\sin\left(\theta\right)\cos\left(\phi\right)+\sin\left(\psi\right)\sin\left(\phi\right)\\ \sin\left(\psi\right)\cos\left(\theta\right) & \sin\left(\psi\right)\sin\left(\theta\right)\sin\left(\phi\right)+\cos\left(\psi\right)\cos\left(\phi\right) & \sin\left(\psi\right)\sin\left(\theta\right)\cos\left(\phi\right)-\cos\left(\psi\right)\sin\left(\phi\right)\\ -\sin\left(\theta\right) & \cos\left(\theta\right)\sin\left(\phi\right) & \cos\left(\theta\right)\cos\left(\phi\right)\end{array}\right] \]

Definition at line 75 of file rtcRotation.h.


Constructor & Destructor Documentation

template<class T >
rtc::Rotation< T >::Rotation ( ) [inline]

Constructor.

Ctor that intializes to an identity rotation matrix.

Definition at line 116 of file rtcRotation.h.

template<class T >
rtc::Rotation< T >::Rotation ( const T  x11,
const T  x12,
const T  x13,
const T  x21,
const T  x22,
const T  x23,
const T  x31,
const T  x32,
const T  x33 
) [inline]

Ctor that initializes matrix entries directly.

Definition at line 124 of file rtcRotation.h.

template<class T >
rtc::Rotation< T >::Rotation ( const Mat< T, 3, 3 > &  m) [inline]

Ctor that initializes from Mat<T,3,3>.

Definition at line 135 of file rtcRotation.h.

template<class T >
rtc::Rotation< T >::Rotation ( const Quaternion< T > &  q) [inline]

Ctor that builds a rotation matrix from a quaternion Precondition: quaternion must have unit norm for matrix to have unit norm

Definition at line 141 of file rtcRotation.h.

template<class T >
rtc::Rotation< T >::Rotation ( const EulerAngles< T > &  e) [inline]

Ctor that builds a rotation matrix from euler angles

Definition at line 148 of file rtcRotation.h.

template<class T >
template<class U >
rtc::Rotation< T >::Rotation ( const Mat< U, 3, 3 > &  m) [inline]

Casting Operation.

Casting Ctor that initializes from a Mat<U,3,3> with type cast

Definition at line 155 of file rtcRotation.h.


Member Function Documentation

template<class T >
void rtc::Rotation< T >::apply ( Vec3< T > &  v) const [inline]

Helper for applying the rotation to points: Rotation * Vec.

Helper for applying the rotation to points: Rotation * Vec3

Definition at line 204 of file rtcRotation.h.

template<class T >
Vec3< T > rtc::Rotation< T >::apply ( const Vec3< T > &  v) const [inline]

Helper for applying the rotation to points: Rotation * Vec3

Definition at line 211 of file rtcRotation.h.

template<class T >
void rtc::Rotation< T >::set ( const Quaternion< T > &  q) [inline]

Mutators.

Set the rotation matrix according to passed quaternion Precondition: quaternion must have unit norm for matrix to have unit norm

Definition at line 163 of file rtcRotation.h.

template<class T >
void rtc::Rotation< T >::set ( const EulerAngles< T > &  e) [inline]

Set the rotation matrix according to passed euler angles

Definition at line 178 of file rtcRotation.h.

template<class T >
void rtc::Rotation< T >::set ( const T  theta,
const T  phi 
) [inline]

Set the rotation matrix according to passed 2 angles

Definition at line 196 of file rtcRotation.h.


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


rtc
Author(s): Benjamin Pitzer
autogenerated on Thu Jan 2 2014 11:04:54