|
My Project
|
a class to implement a quaternion More...
#include <mia/3d/quaternion.hh>
Public Member Functions | |
| C3DDVector | get_euler_angles () const |
| const C3DDMatrix | get_rotation_matrix () const |
| Quaternion | inverse () const |
| double | norm () const |
| void | normalize () |
| normalizes to quaternion | |
| Quaternion & | operator*= (const Quaternion &other) |
| Quaternion & | operator+= (const Quaternion &other) |
| Quaternion & | operator-= (const Quaternion &other) |
| void | print (std::ostream &os) const |
| Quaternion () | |
| Quaternion (const C3DDMatrix &rot) | |
| Quaternion (const C3DDVector &rot) | |
| Quaternion (const C3DFMatrix &rot) | |
| Quaternion (const Quaternion &other)=default | |
| Quaternion (double w, double x, double y, double z) | |
| double | w () const |
| double | x () const |
| double | y () const |
| double | z () const |
Static Public Attributes | |
| static const Quaternion | _1 |
Friends | |
| bool | operator== (const Quaternion &a, const Quaternion &b) |
a class to implement a quaternion
This class implements some operations of a quaternion. The rotation is implemented as clockwise/left-handed rotation.
Definition at line 43 of file quaternion.hh.
| Quaternion::Quaternion | ( | ) |
The standard constructor that sets all values of the quaternion to zero.
Referenced by inverse(), operator*=(), operator+=(), operator-=(), operator==, and Quaternion().
|
default |
| Quaternion::Quaternion | ( | const C3DDVector & | rot | ) |
This constructor creates a quaternion from three Euler angles that are applied with the x-y-z convention.
| rot |
| Quaternion::Quaternion | ( | const C3DFMatrix & | rot | ) |
This constructor creates a quaternion from a 3x3 rotation matrix. If mat3x3 is not a true rotation matrix, then this constructor evaluates the rotation quaternion that best resembles the matrix transformation.
| rot |
| Quaternion::Quaternion | ( | const C3DDMatrix & | rot | ) |
This constructor creates a quaternion from a 3x3 rotation matrix. If mat3x3 is not a true rotation matrix, then this constructor evaluates the rotation quaternion that best resembles the matrix transformation.
| rot |
| Quaternion::Quaternion | ( | double | w, |
| double | x, | ||
| double | y, | ||
| double | z ) |
| C3DDVector Quaternion::get_euler_angles | ( | ) | const |
| const C3DDMatrix Quaternion::get_rotation_matrix | ( | ) | const |
| Quaternion Quaternion::inverse | ( | ) | const |
References Quaternion().
| double Quaternion::norm | ( | ) | const |
| void Quaternion::normalize | ( | ) |
normalizes to quaternion
| Quaternion & Quaternion::operator*= | ( | const Quaternion & | other | ) |
in-place multiplication
| other |
References Quaternion().
| Quaternion & Quaternion::operator+= | ( | const Quaternion & | other | ) |
in-place adding
| other |
References Quaternion().
| Quaternion & Quaternion::operator-= | ( | const Quaternion & | other | ) |
in-place substraction
| other |
References Quaternion().
| void Quaternion::print | ( | std::ostream & | os | ) | const |
Print the quaternion to an output stream
| os | the output stream |
References w(), x(), y(), and z().
Referenced by operator<<().
|
inline |
Definition at line 160 of file quaternion.hh.
Referenced by print(), and Quaternion().
|
inline |
Definition at line 165 of file quaternion.hh.
Referenced by print(), and Quaternion().
|
inline |
Definition at line 170 of file quaternion.hh.
Referenced by print(), and Quaternion().
|
inline |
Definition at line 175 of file quaternion.hh.
Referenced by print(), and Quaternion().
|
friend |
|
static |
Definition at line 149 of file quaternion.hh.