#include <math_quaternion.h>
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_type > | vector3_type |
typedef Matrix3x3< value_type > | matrix3x3_type |
typedef size_t | index_type |
Public Member Functions | |
value_type & | s () |
value_type const & | s () const |
vector3_type & | v () |
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) | |
Quaternion & | operator= (Quaternion const &cpy) |
Quaternion & | operator= (matrix3x3_type const &M) |
bool | operator== (Quaternion const &cmp) const |
bool | operator!= (Quaternion const &cmp) const |
Quaternion & | operator+= (Quaternion const &q) |
Quaternion & | operator-= (Quaternion const &q) |
Quaternion | operator+ (Quaternion const &q) const |
Quaternion | operator- (Quaternion const &q) const |
Quaternion & | operator*= (value_type const &s_val) |
Quaternion & | operator/= (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. |
typedef size_t OpenTissue::math::Quaternion< value_type_ >::index_type |
typedef Matrix3x3<value_type> OpenTissue::math::Quaternion< value_type_ >::matrix3x3_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.
typedef OpenTissue::math::ValueTraits<value_type_> OpenTissue::math::Quaternion< value_type_ >::value_traits_ [protected] |
typedef value_type_ OpenTissue::math::Quaternion< value_type_ >::value_type |
Typedef is required for compliance with many other libraries and data containers!
typedef Vector3<value_type> OpenTissue::math::Quaternion< value_type_ >::vector3_type |
OpenTissue::math::Quaternion< value_type_ >::Quaternion | ( | ) | [inline] |
OpenTissue::math::Quaternion< value_type_ >::~Quaternion | ( | ) | [inline] |
OpenTissue::math::Quaternion< value_type_ >::Quaternion | ( | Quaternion< value_type_ > const & | q | ) | [inline] |
OpenTissue::math::Quaternion< value_type_ >::Quaternion | ( | matrix3x3_type const & | M | ) | [inline, explicit] |
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] |
OpenTissue::math::Quaternion< value_type_ >::Quaternion | ( | value_type const & | s_val, | |
vector3_type const & | v_val | |||
) | [inline, explicit] |
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.
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.
q | A reference to a Quaternion. This is the Quaternion to compare with. | |
threshold | A reference to the acceptable error bound. |
bool OpenTissue::math::Quaternion< value_type_ >::operator!= | ( | Quaternion< value_type_ > const & | cmp | ) | const [inline] |
Quaternion OpenTissue::math::Quaternion< value_type_ >::operator% | ( | vector3_type const & | v_val | ) | [inline] |
Quaternion Vector Multiplication.
v | A Quaternion as a vector, i.e. zero scalar value. |
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.
b | The second Quaternion. |
value_type OpenTissue::math::Quaternion< value_type_ >::operator* | ( | Quaternion< value_type_ > const & | q | ) | const [inline] |
Quaternion& OpenTissue::math::Quaternion< value_type_ >::operator*= | ( | value_type const & | s_val | ) | [inline] |
Quaternion OpenTissue::math::Quaternion< value_type_ >::operator+ | ( | Quaternion< value_type_ > const & | q | ) | const [inline] |
Quaternion& OpenTissue::math::Quaternion< value_type_ >::operator+= | ( | Quaternion< value_type_ > const & | q | ) | [inline] |
Quaternion OpenTissue::math::Quaternion< value_type_ >::operator- | ( | Quaternion< value_type_ > const & | q | ) | const [inline] |
Quaternion OpenTissue::math::Quaternion< value_type_ >::operator- | ( | ) | const [inline] |
Quaternion& OpenTissue::math::Quaternion< value_type_ >::operator-= | ( | Quaternion< value_type_ > const & | q | ) | [inline] |
Quaternion& OpenTissue::math::Quaternion< value_type_ >::operator/= | ( | value_type const & | s_val | ) | [inline] |
Quaternion& OpenTissue::math::Quaternion< value_type_ >::operator= | ( | Quaternion< value_type_ > const & | cpy | ) | [inline] |
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.
M | A reference to a matrix. This matrix should be a rotation matrix. That is an othogonal matrix. |
bool OpenTissue::math::Quaternion< value_type_ >::operator== | ( | Quaternion< value_type_ > const & | cmp | ) | const [inline] |
void OpenTissue::math::Quaternion< value_type_ >::random | ( | value_type const & | min_value, | |
value_type const & | max_value | |||
) | [inline] |
void OpenTissue::math::Quaternion< value_type_ >::random | ( | ) | [inline] |
vector3_type OpenTissue::math::Quaternion< value_type_ >::rotate | ( | vector3_type const & | r | ) | const [inline] |
Rotate Vector by Quaternion.
computes r' = q*r*conj(q)
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.
rad | The rotation angle in radians around the axe. | |
axe | The axe of rotation. |
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.
rad | The rotation angle in radians around the axe. |
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.
rad | The rotation angle in radians around the axe. |
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.
rad | The rotation angle in radians around the axe. |
value_type const& OpenTissue::math::Quaternion< value_type_ >::s | ( | ) | const [inline] |
value_type& OpenTissue::math::Quaternion< value_type_ >::s | ( | ) | [inline] |
vector3_type& OpenTissue::math::Quaternion< value_type_ >::v | ( | ) | [inline] |
vector3_type const& OpenTissue::math::Quaternion< value_type_ >::v | ( | ) | const [inline] |
value_type OpenTissue::math::Quaternion< value_type_ >::m_s [protected] |
The real part.
vector3_type OpenTissue::math::Quaternion< value_type_ >::m_v [protected] |
The R3 part or imaginary part.