Public Types | Public Member Functions | Protected Types | Protected Attributes

OpenTissue::math::Quaternion< value_type_ > Class Template Reference

#include <math_quaternion.h>

List of all members.

Public Types

typedef value_traits_ value_traits
 Convience typedef to make value traits accesible for all template functions using Vector3 types.
typedef value_type_ value_type
 Typedef is required for compliance with many other libraries and data containers!
typedef Vector3< value_typevector3_type
typedef Matrix3x3< value_typematrix3x3_type
typedef size_t index_type

Public Member Functions

value_types ()
value_type const & s () const
vector3_typev ()
vector3_type const & v () const
 Quaternion ()
 ~Quaternion ()
 Quaternion (Quaternion const &q)
 Quaternion (matrix3x3_type const &M)
 Quaternion (value_type const &s_val, value_type const &x, value_type const &y, value_type const &z)
 Quaternion (value_type const &s_val, vector3_type const &v_val)
Quaternionoperator= (Quaternion const &cpy)
Quaternionoperator= (matrix3x3_type const &M)
bool operator== (Quaternion const &cmp) const
bool operator!= (Quaternion const &cmp) const
Quaternionoperator+= (Quaternion const &q)
Quaternionoperator-= (Quaternion const &q)
Quaternion operator+ (Quaternion const &q) const
Quaternion operator- (Quaternion const &q) const
Quaternionoperator*= (value_type const &s_val)
Quaternionoperator/= (value_type const &s_val)
Quaternion operator- () const
value_type operator* (Quaternion const &q) const
Quaternion operator% (Quaternion const &b)
Quaternion operator% (vector3_type const &v_val)
void random (value_type const &min_value, value_type const &max_value)
void random ()
void Ru (value_type const &rad, vector3_type const &axe)
void identity ()
void Rx (value_type const &rad)
void Ry (value_type const &rad)
void Rz (value_type const &rad)
vector3_type rotate (vector3_type const &r) const
bool is_equal (Quaternion const &q, value_type const &threshold) const

Protected Types

typedef
OpenTissue::math::ValueTraits
< value_type_ > 
value_traits_

Protected Attributes

value_type m_s
 The real part.
vector3_type m_v
 The R3 part or imaginary part.

template<typename value_type_>
class OpenTissue::math::Quaternion< value_type_ >


Member Typedef Documentation

template<typename value_type_>
typedef size_t OpenTissue::math::Quaternion< value_type_ >::index_type
template<typename value_type_>
typedef Matrix3x3<value_type> OpenTissue::math::Quaternion< value_type_ >::matrix3x3_type
template<typename value_type_>
typedef value_traits_ OpenTissue::math::Quaternion< value_type_ >::value_traits

Convience typedef to make value traits accesible for all template functions using Vector3 types.

template<typename value_type_>
typedef OpenTissue::math::ValueTraits<value_type_> OpenTissue::math::Quaternion< value_type_ >::value_traits_ [protected]
template<typename value_type_>
typedef value_type_ OpenTissue::math::Quaternion< value_type_ >::value_type

Typedef is required for compliance with many other libraries and data containers!

template<typename value_type_>
typedef Vector3<value_type> OpenTissue::math::Quaternion< value_type_ >::vector3_type

Constructor & Destructor Documentation

template<typename value_type_>
OpenTissue::math::Quaternion< value_type_ >::Quaternion (  )  [inline]
template<typename value_type_>
OpenTissue::math::Quaternion< value_type_ >::~Quaternion (  )  [inline]
template<typename value_type_>
OpenTissue::math::Quaternion< value_type_ >::Quaternion ( Quaternion< value_type_ > const &  q  )  [inline]
template<typename value_type_>
OpenTissue::math::Quaternion< value_type_ >::Quaternion ( matrix3x3_type const &  M  )  [inline, explicit]
template<typename value_type_>
OpenTissue::math::Quaternion< value_type_ >::Quaternion ( value_type const &  s_val,
value_type const &  x,
value_type const &  y,
value_type const &  z 
) [inline, explicit]
template<typename value_type_>
OpenTissue::math::Quaternion< value_type_ >::Quaternion ( value_type const &  s_val,
vector3_type const &  v_val 
) [inline, explicit]

Member Function Documentation

template<typename value_type_>
void OpenTissue::math::Quaternion< value_type_ >::identity (  )  [inline]

Assigns the quaterion to the identity rotation. This is a commonly used constant. It corresponds to the identity matrix.

template<typename value_type_>
bool OpenTissue::math::Quaternion< value_type_ >::is_equal ( Quaternion< value_type_ > const &  q,
value_type const &  threshold 
) const [inline]

Equality comparison with an error bound. The test is exactly the same as with the method without errorbound the only difference is that the corresponding terms of the quaternions are said to be equal if they do not differ by more than the error bound value.

Parameters:
q A reference to a Quaternion. This is the Quaternion to compare with.
threshold A reference to the acceptable error bound.
Returns:
The test result. The return value is one if the quaternions are equal otherwise the return value is zero.
template<typename value_type_>
bool OpenTissue::math::Quaternion< value_type_ >::operator!= ( Quaternion< value_type_ > const &  cmp  )  const [inline]
template<typename value_type_>
Quaternion OpenTissue::math::Quaternion< value_type_ >::operator% ( vector3_type const &  v_val  )  [inline]

Quaternion Vector Multiplication.

Parameters:
v A Quaternion as a vector, i.e. zero scalar value.
template<typename value_type_>
Quaternion OpenTissue::math::Quaternion< value_type_ >::operator% ( Quaternion< value_type_ > const &  b  )  [inline]

Multiplication of quaternions. This method multiplies two quaterions with each other and assigns the result to this Quaternion.

Parameters:
b The second Quaternion.
template<typename value_type_>
value_type OpenTissue::math::Quaternion< value_type_ >::operator* ( Quaternion< value_type_ > const &  q  )  const [inline]
template<typename value_type_>
Quaternion& OpenTissue::math::Quaternion< value_type_ >::operator*= ( value_type const &  s_val  )  [inline]
template<typename value_type_>
Quaternion OpenTissue::math::Quaternion< value_type_ >::operator+ ( Quaternion< value_type_ > const &  q  )  const [inline]
template<typename value_type_>
Quaternion& OpenTissue::math::Quaternion< value_type_ >::operator+= ( Quaternion< value_type_ > const &  q  )  [inline]
template<typename value_type_>
Quaternion OpenTissue::math::Quaternion< value_type_ >::operator- ( Quaternion< value_type_ > const &  q  )  const [inline]
template<typename value_type_>
Quaternion OpenTissue::math::Quaternion< value_type_ >::operator- (  )  const [inline]
template<typename value_type_>
Quaternion& OpenTissue::math::Quaternion< value_type_ >::operator-= ( Quaternion< value_type_ > const &  q  )  [inline]
template<typename value_type_>
Quaternion& OpenTissue::math::Quaternion< value_type_ >::operator/= ( value_type const &  s_val  )  [inline]
template<typename value_type_>
Quaternion& OpenTissue::math::Quaternion< value_type_ >::operator= ( Quaternion< value_type_ > const &  cpy  )  [inline]
template<typename value_type_>
Quaternion& OpenTissue::math::Quaternion< value_type_ >::operator= ( matrix3x3_type const &  M  )  [inline]

Assignment operator. This method is a little speciel. Quaternions can be used to represent rotations, so can matrices. This method transforms a rotation matrix into a Quaternion and then it assigns it to this Quaternion. In short this method converts matrices into quaternions.

Parameters:
M A reference to a matrix. This matrix should be a rotation matrix. That is an othogonal matrix.
template<typename value_type_>
bool OpenTissue::math::Quaternion< value_type_ >::operator== ( Quaternion< value_type_ > const &  cmp  )  const [inline]
template<typename value_type_>
void OpenTissue::math::Quaternion< value_type_ >::random ( value_type const &  min_value,
value_type const &  max_value 
) [inline]
template<typename value_type_>
void OpenTissue::math::Quaternion< value_type_ >::random (  )  [inline]
template<typename value_type_>
vector3_type OpenTissue::math::Quaternion< value_type_ >::rotate ( vector3_type const &  r  )  const [inline]

Rotate Vector by Quaternion.

computes r' = q*r*conj(q)

template<typename value_type_>
void OpenTissue::math::Quaternion< value_type_ >::Ru ( value_type const &  rad,
vector3_type const &  axe 
) [inline]

A rotation around an arbitary axe. This method constructs a unit Quaternion which represents the specified rotation.

Parameters:
rad The rotation angle in radians around the axe.
axe The axe of rotation.
template<typename value_type_>
void OpenTissue::math::Quaternion< value_type_ >::Rx ( value_type const &  rad  )  [inline]

This method constructs a unit Quaternion which represents the specified rotation around the x-axe.

Parameters:
rad The rotation angle in radians around the axe.
template<typename value_type_>
void OpenTissue::math::Quaternion< value_type_ >::Ry ( value_type const &  rad  )  [inline]

This method constructs a unit Quaternion which represents the specified rotation around the y-axe.

Parameters:
rad The rotation angle in radians around the axe.
template<typename value_type_>
void OpenTissue::math::Quaternion< value_type_ >::Rz ( value_type const &  rad  )  [inline]

This method constructs a unit Quaternion which represents the specified rotation around the z-axe.

Parameters:
rad The rotation angle in radians around the axe.
template<typename value_type_>
value_type const& OpenTissue::math::Quaternion< value_type_ >::s (  )  const [inline]
template<typename value_type_>
value_type& OpenTissue::math::Quaternion< value_type_ >::s (  )  [inline]
template<typename value_type_>
vector3_type& OpenTissue::math::Quaternion< value_type_ >::v (  )  [inline]
template<typename value_type_>
vector3_type const& OpenTissue::math::Quaternion< value_type_ >::v (  )  const [inline]

Member Data Documentation

template<typename value_type_>
value_type OpenTissue::math::Quaternion< value_type_ >::m_s [protected]

The real part.

template<typename value_type_>
vector3_type OpenTissue::math::Quaternion< value_type_ >::m_v [protected]

The R3 part or imaginary part.


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