# TUnitQuaternionTemplate< T > Class Template Reference
[Math classes]

Inheritance diagram for TUnitQuaternionTemplate< T >:

List of all members.

## Public Member Functions
| TUnitQuaternionTemplate ()
| TUnitQuaternionTemplate (const T &x, const T &y, const T &z, const T &t)
template<class U >
| TUnitQuaternionTemplate (const TUnitQuaternionTemplate< U > &q)
void | Set (const T &x, const T &y, const T &z, const T &t)
TUnitQuaternionTemplate< T > | Square (void) const
TUnitQuaternionTemplate< T > | Inverse (void) const
TUnitQuaternionTemplate< T > | SquareRoot (void) const
TUnitQuaternionTemplate< T > | Exp (void) const
TUnitQuaternionTemplate< T > | Log (void) const
void | Normalize (void)
TUnitComplex | GetAngle (void) const
void | GetAxis (TVector3Template< T > &axis) const
void | GetMatrix (TVector3Template< T > &II, TVector3Template< T > &JJ, TVector3Template< T > &KK) const
void | GetMatrix (TMatrix33Template< T > &m) const
void | SetFromAxis (const TVector3Template< T > &axis, const TUnitComplex &angle)
void | SetFromTransition (const TVector3Template< T > &PP, const TVector3Template< T > &QQ, const TVector3Template< T > &AXIS)
void | SetFromTransition (const TVector3Template< T > &PP, const TVector3Template< T > &QQ)
void | SetFromVirtual (const TVector2Template< T > &V1, const TVector2Template< T > &V2)
void | SetFromMatrix (const TVector3Template< T > &II, const TVector3Template< T > &JJ, const TVector3Template< T > &KK)
void | SetFromMatrix (const TMatrix33Template< T > &m)
void | SetFromInterpolate (const T &lamda, const TUnitQuaternionTemplate< T > &q1, const TUnitQuaternionTemplate< T > &q2)
template<class U >
void | Transform (const TVector3Template< U > &PP, TVector3Template< U > &QQ) const
template<class U >
void | InverseTransform (const TVector3Template< U > &PP, TVector3Template< U > &QQ) const
template<class U >
TVector3Template< U > | Transform (const TVector3Template< U > &PP) const
template<class U >
TVector3Template< U > | InverseTransform (const TVector3Template< U > &PP) const
TUnitQuaternionTemplate< T > & | operator*= (const T &s)
TUnitQuaternionTemplate< T > & | operator+= (const TUnitQuaternionTemplate< T > &q)
TUnitQuaternionTemplate< T > & | operator-= (const TUnitQuaternionTemplate< T > &q)
TUnitQuaternionTemplate< T > | operator+ (const TUnitQuaternionTemplate< T > &q) const
TUnitQuaternionTemplate< T > | operator- (const TUnitQuaternionTemplate< T > &q) const
const T & | Scalar () const
const TVector3Template< T > & | Vector () const
void | MultAngle (const T &v)
boolean | operator== (const TUnitQuaternionTemplate< T > &q1) const
boolean | Equals (const TUnitQuaternionTemplate< T > &q1, const T &epsilon) const
template<class U >
TUnitQuaternionTemplate< T > & | operator= (const TUnitQuaternionTemplate< U > &q)
const T & | GetX () const
const T & | GetY () const
const T & | GetZ () const
const T & | GetT () const
TUnitQuaternionTemplate< T > | operator* (const TUnitQuaternionTemplate< T > &q) const
## Static Public Attributes
static const TUnitQuaternionTemplate< T > | kIdentity
## Protected Attributes
T | ft
T | fx
T | fy
T | fz
## Static Private Member Functions
template<class U >
static void | Transform (const T &qt, const T &qx, const T &qy, const T &qz, const TVector3Template< U > &PP, TVector3Template< U > &QQ)
## Friends
TMCiostream & | operator<< (TMCiostream &, const TUnitQuaternion &)
TMCiostream & | operator>> (TMCiostream &, TUnitQuaternion &)

## Detailed Description

### template<class T>
class TUnitQuaternionTemplate< T >

Stores a rotation around an axis as a quaternion of norm one.

     void TUnitQuaternion::SetFromAxis(const TVector3& axis, const TUnitComplex& angle)
     {
            real cos, sin;
            angle.SquareRoot().GetSinCos(sin, cos);
            ft = cos;
            fx = axis[0] * sin;
            fy = axis[1] * sin;
            fz = axis[2] * sin;
     }

## Constructor & Destructor Documentation

template<class T>

TUnitQuaternionTemplate< T >::TUnitQuaternionTemplate | ( |  | ) |

template<class T>

TUnitQuaternionTemplate< T >::TUnitQuaternionTemplate | ( | const T & | x,
|  | const T & | y,
|  | const T & | z,
|  | const T & | t |
| ) |  |  |

template<class T>
template<class U >

TUnitQuaternionTemplate< T >::TUnitQuaternionTemplate | ( | const TUnitQuaternionTemplate< U > & | q | ) | `[inline]`

## Member Function Documentation

template<class T>

boolean TUnitQuaternionTemplate< T >::Equals | ( | const TUnitQuaternionTemplate< T > & | q1,
|  | const T & | epsilon |
| ) |  |  | const

template<class T>

TUnitQuaternionTemplate<T> TUnitQuaternionTemplate< T >::Exp | ( | void |  | ) | const

template<class T>

TUnitComplex TUnitQuaternionTemplate< T >::GetAngle | ( | void |  | ) | const

return the correct complex (cos(x), sin(x)) where ft=cos(1/2 x)

template<class T>

void TUnitQuaternionTemplate< T >::GetAxis | ( | TVector3Template< T > & | axis | ) | const

template<class T>

void TUnitQuaternionTemplate< T >::GetMatrix | ( | TMatrix33Template< T > & | m | ) | const

template<class T>

void TUnitQuaternionTemplate< T >::GetMatrix | ( | TVector3Template< T > & | II,
|  | TVector3Template< T > & | JJ,
|  | TVector3Template< T > & | KK |
| ) |  |  | const

template<class T>

const T& TUnitQuaternionTemplate< T >::GetT | ( |  | ) | const`[inline]`

template<class T>

const T& TUnitQuaternionTemplate< T >::GetX | ( |  | ) | const`[inline]`

template<class T>

const T& TUnitQuaternionTemplate< T >::GetY | ( |  | ) | const`[inline]`

template<class T>

const T& TUnitQuaternionTemplate< T >::GetZ | ( |  | ) | const`[inline]`

template<class T>

TUnitQuaternionTemplate<T> TUnitQuaternionTemplate< T >::Inverse | ( | void |  | ) | const

template<class T>
template<class U >

TVector3Template<U> TUnitQuaternionTemplate< T >::InverseTransform | ( | const TVector3Template< U > & | PP | ) | const`[inline]`

template<class T>
template<class U >

void TUnitQuaternionTemplate< T >::InverseTransform | ( | const TVector3Template< U > & | PP,
|  | TVector3Template< U > & | QQ |
| ) |  |  | const`[inline]`

template<class T>

TUnitQuaternionTemplate<T> TUnitQuaternionTemplate< T >::Log | ( | void |  | ) | const

template<class T>

void TUnitQuaternionTemplate< T >::MultAngle | ( | const T & | v | ) |

template<class T>

void TUnitQuaternionTemplate< T >::Normalize | ( | void |  | ) |

template<class T>

TUnitQuaternionTemplate<T> TUnitQuaternionTemplate< T >::operator* | ( | const TUnitQuaternionTemplate< T > & | q | ) | const

template<class T>

TUnitQuaternionTemplate<T>& TUnitQuaternionTemplate< T >::operator*= | ( | const T & | s | ) |

template<class T>

TUnitQuaternionTemplate<T> TUnitQuaternionTemplate< T >::operator+ | ( | const TUnitQuaternionTemplate< T > & | q | ) | const

template<class T>

TUnitQuaternionTemplate<T>& TUnitQuaternionTemplate< T >::operator+= | ( | const TUnitQuaternionTemplate< T > & | q | ) |

template<class T>

TUnitQuaternionTemplate<T> TUnitQuaternionTemplate< T >::operator- | ( | const TUnitQuaternionTemplate< T > & | q | ) | const

template<class T>

TUnitQuaternionTemplate<T>& TUnitQuaternionTemplate< T >::operator-= | ( | const TUnitQuaternionTemplate< T > & | q | ) |

template<class T>
template<class U >

TUnitQuaternionTemplate<T>& TUnitQuaternionTemplate< T >::operator= | ( | const TUnitQuaternionTemplate< U > & | q | ) | `[inline]`

template<class T>

boolean TUnitQuaternionTemplate< T >::operator== | ( | const TUnitQuaternionTemplate< T > & | q1 | ) | const

template<class T>

const T& TUnitQuaternionTemplate< T >::Scalar | ( |  | ) | const`[inline]`

template<class T>

void TUnitQuaternionTemplate< T >::Set | ( | const T & | x,
|  | const T & | y,
|  | const T & | z,
|  | const T & | t |
| ) |  |  |

template<class T>

void TUnitQuaternionTemplate< T >::SetFromAxis | ( | const TVector3Template< T > & | axis,
|  | const TUnitComplex & | angle |
| ) |  |  |

template<class T>

void TUnitQuaternionTemplate< T >::SetFromInterpolate | ( | const T & | lamda,
|  | const TUnitQuaternionTemplate< T > & | q1,
|  | const TUnitQuaternionTemplate< T > & | q2 |
| ) |  |  |

template<class T>

void TUnitQuaternionTemplate< T >::SetFromMatrix | ( | const TMatrix33Template< T > & | m | ) |

template<class T>

void TUnitQuaternionTemplate< T >::SetFromMatrix | ( | const TVector3Template< T > & | II,
|  | const TVector3Template< T > & | JJ,
|  | const TVector3Template< T > & | KK |
| ) |  |  |

template<class T>

void TUnitQuaternionTemplate< T >::SetFromTransition | ( | const TVector3Template< T > & | PP,
|  | const TVector3Template< T > & | QQ |
| ) |  |  |

template<class T>

void TUnitQuaternionTemplate< T >::SetFromTransition | ( | const TVector3Template< T > & | PP,
|  | const TVector3Template< T > & | QQ,
|  | const TVector3Template< T > & | AXIS |
| ) |  |  |

template<class T>

void TUnitQuaternionTemplate< T >::SetFromVirtual | ( | const TVector2Template< T > & | V1,
|  | const TVector2Template< T > & | V2 |
| ) |  |  |

template<class T>

TUnitQuaternionTemplate<T> TUnitQuaternionTemplate< T >::Square | ( | void |  | ) | const

template<class T>

TUnitQuaternionTemplate<T> TUnitQuaternionTemplate< T >::SquareRoot | ( | void |  | ) | const

template<class T>
template<class U >

static void TUnitQuaternionTemplate< T >::Transform | ( | const T & | qt,
|  | const T & | qx,
|  | const T & | qy,
|  | const T & | qz,
|  | const TVector3Template< U > & | PP,
|  | TVector3Template< U > & | QQ |
| ) |  |  | `[inline, static, private]`

template<class T>
template<class U >

TVector3Template<U> TUnitQuaternionTemplate< T >::Transform | ( | const TVector3Template< U > & | PP | ) | const`[inline]`

template<class T>
template<class U >

void TUnitQuaternionTemplate< T >::Transform | ( | const TVector3Template< U > & | PP,
|  | TVector3Template< U > & | QQ |
| ) |  |  | const`[inline]`

template<class T>

const TVector3Template<T>& TUnitQuaternionTemplate< T >::Vector | ( |  | ) | const`[inline]`

## Friends And Related Function Documentation

template<class T>

TMCiostream& operator<< | ( | TMCiostream & | ,
|  | const TUnitQuaternion & |  |
| ) |  |  | `[friend]`

template<class T>

TMCiostream& operator>> | ( | TMCiostream & | ,
|  | TUnitQuaternion & |  |
| ) |  |  | `[friend]`

## Member Data Documentation

template<class T>

T TUnitQuaternionTemplate< T >::ft`[protected]`

template<class T>

T TUnitQuaternionTemplate< T >::fx`[protected]`

template<class T>

T TUnitQuaternionTemplate< T >::fy`[protected]`

template<class T>

T TUnitQuaternionTemplate< T >::fz`[protected]`

template<class T>

const TUnitQuaternionTemplate<T> TUnitQuaternionTemplate< T >::kIdentity`[static]`

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

- RealQuat.h