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 More... | |
Quaternion & | operator*= (const Quaternion &other) |
Quaternion & | operator+= (const Quaternion &other) |
Quaternion & | operator-= (const Quaternion &other) |
void | print (std::ostream &os) const |
Quaternion () | |
Quaternion (const Quaternion &other)=default | |
Quaternion (const C3DDVector &rot) | |
Quaternion (const C3DFMatrix &rot) | |
Quaternion (const C3DDMatrix &rot) | |
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.
|
default |
The copy constructor.
other |
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 | ||
) |
Constructor to create a quaternion by directly setting its elements.
C3DDVector Quaternion::get_euler_angles | ( | ) | const |
const C3DDMatrix Quaternion::get_rotation_matrix | ( | ) | const |
Quaternion Quaternion::inverse | ( | ) | const |
double Quaternion::norm | ( | ) | const |
void Quaternion::normalize | ( | ) |
normalizes to quaternion
Quaternion& Quaternion::operator*= | ( | const Quaternion & | other | ) |
in-place multiplication
other |
Quaternion& Quaternion::operator+= | ( | const Quaternion & | other | ) |
in-place adding
other |
Quaternion& Quaternion::operator-= | ( | const Quaternion & | other | ) |
in-place substraction
other |
void Quaternion::print | ( | std::ostream & | os | ) | const |
|
inline |
Definition at line 159 of file quaternion.hh.
|
inline |
Definition at line 164 of file quaternion.hh.
|
inline |
Definition at line 169 of file quaternion.hh.
|
inline |
Definition at line 174 of file quaternion.hh.
|
friend |
a | |
b |
|
static |
Definition at line 148 of file quaternion.hh.