vmmlib  1.11.0
Templatized C++ vector and matrix math library
vmml::Quaternion< T > Class Template Reference
+ Collaboration diagram for vmml::Quaternion< T >:

Public Member Functions

 Quaternion ()
 Construct an identity quaternion.
 
 Quaternion (T x, T y, T z, T w)
 
 Quaternion (T angle, vector< 3, T > axis)
 Construct a rotation quaternion.
 
template<size_t M>
 Quaternion (const Matrix< M, M, T > &rotation_matrix_, typename enable_if< M >=3 >::type *=0)
 
void normalize ()
 
Quaternionoperator= (const Quaternion &other)
 
Data Access
bool equals (const Quaternion &other, T tolerance=std::numeric_limits< T >::epsilon()) const
 
x () const
 
y () const
 
z () const
 
w () const
 
bool operator== (const Quaternion &a) const
 
bool operator!= (const Quaternion &a) const
 
Quaternion operator- () const
 
Quaternion inverse () const
 
Quaternion getConjugate () const
 
abs () const
 
absSquare () const
 
Matrix< 3, 3, T > getRotationMatrix () const
 
quaternion/quaternion operations
Quaternion operator+ (const Quaternion< T > &a) const
 
Quaternion operator- (const Quaternion< T > &a) const
 
Quaternion operator* (const Quaternion< T > &a) const
 
void operator+= (const Quaternion< T > &a)
 
void operator-= (const Quaternion< T > &a)
 
void operator*= (const Quaternion< T > &a)
 
quaternion/scalar operations
Quaternion operator* (T a) const
 
Quaternion operator/ (T a) const
 
void operator*= (T a)
 
void operator/= (T a)
 

Friends

std::ostream & operator<< (std::ostream &os, const Quaternion &q)
 

Detailed Description

template<typename T>
class vmml::Quaternion< T >

Definition at line 49 of file quaternion.hpp.

Member Function Documentation

template<typename T >
bool vmml::Quaternion< T >::equals ( const Quaternion< T > &  other,
tolerance = std::numeric_limits< T >::epsilon( ) 
) const
Returns
true if the two quaternion are similar.

Definition at line 272 of file quaternion.hpp.

template<typename T >
Matrix< 3, 3, T > vmml::Quaternion< T >::getRotationMatrix ( ) const
Returns
the corresponding 3x3 rotation matrix.

Definition at line 447 of file quaternion.hpp.

Referenced by vmml::Matrix< R, C, T >::Matrix().

+ Here is the caller graph for this function:

template<typename T >
Quaternion< T > vmml::Quaternion< T >::inverse ( ) const
Returns
multiplicative inverse quaternion

Definition at line 309 of file quaternion.hpp.

template<typename T >
bool vmml::Quaternion< T >::operator!= ( const Quaternion< T > &  a) const
Returns
true if both quaternions are not equal.

Definition at line 288 of file quaternion.hpp.

template<typename T >
Quaternion< T > vmml::Quaternion< T >::operator- ( ) const
Returns
the negated quaternion of this quaternion.

Definition at line 384 of file quaternion.hpp.

template<typename T >
bool vmml::Quaternion< T >::operator== ( const Quaternion< T > &  a) const
Returns
true if both quaternions are equal.

Definition at line 281 of file quaternion.hpp.


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