# Cinder

# cinder::Quaternion< T > Class Template Reference

`#include <Quaternion.h>`

List of all members.

## Public Types
typedef T | TYPE
## Public Member Functions
| Quaternion ()
template<typename FromT >
| Quaternion (const Quaternion< FromT > &q)
| Quaternion (T aW, T x, T y, T z)
| Quaternion (const Vec3< T > &axis, T radians)
| Quaternion (const Vec3< T > &from, const Vec3< T > &to)
| Quaternion (T xRotation, T yRotation, T zRotation)
| Quaternion (const Matrix44< T > &m)
template<typename Y >
| Quaternion (const Y &v)
Vec3< T > | getAxis () const
T | getAngle () const
T | getPitch () const
T | getYaw () const
T | getRoll () const
T | dot (const Quaternion< T > &quat) const
T | length () const
T | lengthSquared () const
Quaternion< T > | inverse () const
void | normalize ()
Quaternion< T > | normalized () const
Quaternion< T > | log () const
Quaternion< T > | exp () const
Quaternion< T > | inverted () const
void | invert ()
void | set (T aW, T x, T y, T z)
void | set (const Vec3< T > &from, const Vec3< T > &to)
void | set (const Vec3< T > &from, const Vec3< T > &to)
void | set (const Vec3< T > &axis, T radians)
void | set (T xRotation, T yRotation, T zRotation)
void | getAxisAngle (Vec3< T > *axis, T *radians) const
Matrix44< T > | toMatrix44 () const
| operator Matrix44< T > () const
Quaternion< T > | lerp (T t, const Quaternion< T > &end) const
Quaternion< T > | slerpShortestUnenforced (T t, const Quaternion< T > &end) const
Quaternion< T > | slerp (T t, const Quaternion< T > &end) const
Quaternion< T > | squadShortestEnforced (T t, const Quaternion< T > &qa, const Quaternion< T > &qb, const Quaternion< T > &q2) const
Quaternion< T > | squad (T t, const Quaternion< T > &qa, const Quaternion< T > &qb, const Quaternion< T > &q2) const
Quaternion< T > | spline (T t, const Quaternion< T > &q1, const Quaternion< T > &q2, const Quaternion< T > &q3) const
void | set (const Matrix44< T > &m)
Quaternion< T > & | operator= (const Quaternion< T > &rhs)
template<typename FromT >
Quaternion< T > & | operator= (const Quaternion< FromT > &rhs)
const Quaternion< T > | operator+ (const Quaternion< T > &rhs) const
const Quaternion< T > | operator* (const Quaternion< T > &rhs) const
const Quaternion< T > | operator* (T rhs) const
const Vec3< T > | operator* (const Vec3< T > &vec)
const Quaternion< T > | operator- (const Quaternion< T > &rhs) const
Quaternion< T > & | operator+= (const Quaternion< T > &rhs)
Quaternion< T > & | operator-= (const Quaternion< T > &rhs)
Quaternion< T > & | operator*= (const Quaternion< T > &rhs)
Quaternion< T > & | operator*= (T rhs)
bool | operator== (const Quaternion< T > &rhs) const
bool | operator!= (const Quaternion< T > &rhs) const
T & | operator[] (unsigned int i)
const T & | operator[] (unsigned int i) const
## Static Public Member Functions
static void | setRotationInternal (const Vec3< T > &f0, const Vec3< T > &t0, Quaternion< T > &q)
static Quaternion< T > | identity ()
## Public Attributes
Vec3< T > | v
T | w
## Friends
std::ostream & | operator<< (std::ostream &oss, const Quaternion< T > &q)

### template<typename T>
class cinder::Quaternion< T >

## Member Typedef Documentation

template<typename T>

typedef T cinder::Quaternion< T >::TYPE

## Constructor & Destructor Documentation

template<typename T>

cinder::Quaternion< T >::Quaternion | ( |  | ) |

template<typename T>
template<typename FromT >

cinder::Quaternion< T >::Quaternion | ( | const Quaternion< FromT > & | q | ) |

template<typename T>

cinder::Quaternion< T >::Quaternion | ( | T | aW,
|  | T | x,
|  | T | y,
|  | T | z |
| ) |  |  |

template<typename T>

cinder::Quaternion< T >::Quaternion | ( | const Vec3< T > & | axis,
|  | T | radians |
| ) |  |  |

template<typename T>

cinder::Quaternion< T >::Quaternion | ( | const Vec3< T > & | from,
|  | const Vec3< T > & | to |
| ) |  |  |

template<typename T>

cinder::Quaternion< T >::Quaternion | ( | T | xRotation,
|  | T | yRotation,
|  | T | zRotation |
| ) |  |  |

template<typename T>

cinder::Quaternion< T >::Quaternion | ( | const Matrix44< T > & | m | ) |

template<typename T>
template<typename Y >

cinder::Quaternion< T >::Quaternion | ( | const Y & | v | ) | `[explicit]`

## Member Function Documentation

template<typename T>

Vec3<T> cinder::Quaternion< T >::getAxis | ( |  | ) | const

template<typename T>

T cinder::Quaternion< T >::getAngle | ( |  | ) | const

template<typename T>

T cinder::Quaternion< T >::getPitch | ( |  | ) | const

template<typename T>

T cinder::Quaternion< T >::getYaw | ( |  | ) | const

template<typename T>

T cinder::Quaternion< T >::getRoll | ( |  | ) | const

template<typename T>

T cinder::Quaternion< T >::dot | ( | const Quaternion< T > & | quat | ) | const

template<typename T>

T cinder::Quaternion< T >::length | ( |  | ) | const

template<typename T>

T cinder::Quaternion< T >::lengthSquared | ( |  | ) | const

template<typename T>

Quaternion<T> cinder::Quaternion< T >::inverse | ( |  | ) | const

template<typename T>

void cinder::Quaternion< T >::normalize | ( |  | ) |

template<typename T>

Quaternion<T> cinder::Quaternion< T >::normalized | ( |  | ) | const

template<typename T>

Quaternion<T> cinder::Quaternion< T >::log | ( |  | ) | const

template<typename T>

Quaternion<T> cinder::Quaternion< T >::exp | ( |  | ) | const

template<typename T>

Quaternion<T> cinder::Quaternion< T >::inverted | ( |  | ) | const

template<typename T>

void cinder::Quaternion< T >::invert | ( |  | ) |

template<typename T>

void cinder::Quaternion< T >::set | ( | T | aW,
|  | T | x,
|  | T | y,
|  | T | z |
| ) |  |  |

template<typename T>

void cinder::Quaternion< T >::set | ( | const Vec3< T > & | from,
|  | const Vec3< T > & | to |
| ) |  |  |

template<typename T>

void cinder::Quaternion< T >::set | ( | const Vec3< T > & | from,
|  | const Vec3< T > & | to |
| ) |  |  |

template<typename T>

static void cinder::Quaternion< T >::setRotationInternal | ( | const Vec3< T > & | f0,
|  | const Vec3< T > & | t0,
|  | Quaternion< T > & | q |
| ) |  |  | `[static]`

template<typename T>

void cinder::Quaternion< T >::set | ( | const Vec3< T > & | axis,
|  | T | radians |
| ) |  |  |

template<typename T>

void cinder::Quaternion< T >::set | ( | T | xRotation,
|  | T | yRotation,
|  | T | zRotation |
| ) |  |  |

template<typename T>

void cinder::Quaternion< T >::getAxisAngle | ( | Vec3< T > * | axis,
|  | T * | radians |
| ) |  |  | const

template<typename T>

Matrix44<T> cinder::Quaternion< T >::toMatrix44 | ( |  | ) | const

template<typename T>

cinder::Quaternion< T >::operator Matrix44< T > | ( |  | ) | const

template<typename T>

Quaternion<T> cinder::Quaternion< T >::lerp | ( | T | t,
|  | const Quaternion< T > & | end |
| ) |  |  | const

template<typename T>

Quaternion<T> cinder::Quaternion< T >::slerpShortestUnenforced | ( | T | t,
|  | const Quaternion< T > & | end |
| ) |  |  | const

template<typename T>

Quaternion<T> cinder::Quaternion< T >::slerp | ( | T | t,
|  | const Quaternion< T > & | end |
| ) |  |  | const

template<typename T>

Quaternion<T> cinder::Quaternion< T >::squadShortestEnforced | ( | T | t,
|  | const Quaternion< T > & | qa,
|  | const Quaternion< T > & | qb,
|  | const Quaternion< T > & | q2 |
| ) |  |  | const

template<typename T>

Quaternion<T> cinder::Quaternion< T >::squad | ( | T | t,
|  | const Quaternion< T > & | qa,
|  | const Quaternion< T > & | qb,
|  | const Quaternion< T > & | q2 |
| ) |  |  | const

template<typename T>

Quaternion<T> cinder::Quaternion< T >::spline | ( | T | t,
|  | const Quaternion< T > & | q1,
|  | const Quaternion< T > & | q2,
|  | const Quaternion< T > & | q3 |
| ) |  |  | const

template<typename T>

void cinder::Quaternion< T >::set | ( | const Matrix44< T > & | m | ) |

template<typename T>

Quaternion<T>& cinder::Quaternion< T >::operator= | ( | const Quaternion< T > & | rhs | ) |

template<typename T>
template<typename FromT >

Quaternion<T>& cinder::Quaternion< T >::operator= | ( | const Quaternion< FromT > & | rhs | ) |

template<typename T>

const Quaternion<T> cinder::Quaternion< T >::operator+ | ( | const Quaternion< T > & | rhs | ) | const

template<typename T>

const Quaternion<T> cinder::Quaternion< T >::operator* | ( | const Quaternion< T > & | rhs | ) | const

template<typename T>

const Quaternion<T> cinder::Quaternion< T >::operator* | ( | T | rhs | ) | const

template<typename T>

const Vec3<T> cinder::Quaternion< T >::operator* | ( | const Vec3< T > & | vec | ) |

template<typename T>

const Quaternion<T> cinder::Quaternion< T >::operator- | ( | const Quaternion< T > & | rhs | ) | const

template<typename T>

Quaternion<T>& cinder::Quaternion< T >::operator+= | ( | const Quaternion< T > & | rhs | ) |

template<typename T>

Quaternion<T>& cinder::Quaternion< T >::operator-= | ( | const Quaternion< T > & | rhs | ) |

template<typename T>

Quaternion<T>& cinder::Quaternion< T >::operator*= | ( | const Quaternion< T > & | rhs | ) |

template<typename T>

Quaternion<T>& cinder::Quaternion< T >::operator*= | ( | T | rhs | ) |

template<typename T>

bool cinder::Quaternion< T >::operator== | ( | const Quaternion< T > & | rhs | ) | const

template<typename T>

bool cinder::Quaternion< T >::operator!= | ( | const Quaternion< T > & | rhs | ) | const

template<typename T>

T& cinder::Quaternion< T >::operator[] | ( | unsigned int | i | ) |

template<typename T>

const T& cinder::Quaternion< T >::operator[] | ( | unsigned int | i | ) | const

template<typename T>

static Quaternion<T> cinder::Quaternion< T >::identity | ( |  | ) | `[static]`

## Friends And Related Function Documentation

template<typename T>

std::ostream& operator<< | ( | std::ostream & | oss,
|  | const Quaternion< T > & | q |
| ) |  |  | `[friend]`

## Member Data Documentation

template<typename T>

Vec3<T> cinder::Quaternion< T >::v

template<typename T>

T cinder::Quaternion< T >::w

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

- include/cinder/Quaternion.h