Public Methods | |
Quaternion () | |
Default constructor, yields q=(1,0,0,0). | |
Quaternion (const REAL q0, const REAL q1, const REAL q2, const REAL q3, bool unit=true) | |
Creates a unit quaternion from its components (normalized automatically). | |
Quaternion | GetConjugate () const |
Get the conjugate of this quaternion (== the inverse if unit quaternion). | |
Quaternion | operator * (const Quaternion &q) const |
Quaternion multiplication. | |
void | RotateVector (REAL &v1, REAL &v2, REAL &v3) const |
Rotate vector v=(v1,v2,v3). The rotated components are directly written. | |
void | Normalize () |
Re-normalize the quaternion to unity. | |
Static Public Methods | |
Quaternion | RotationQuaternion (const REAL ang, const REAL v1, const REAL v2, const REAL v3) |
Create a rotation quaternion around a given vector for a given angle. | |
Private Attributes | |
REAL | mQ0 |
The components of the quaternion z=(q0,v) with v=(q1,q2,q3). | |
REAL | mQ1 |
The components of the quaternion z=(q0,v) with v=(q1,q2,q3). | |
REAL | mQ2 |
The components of the quaternion z=(q0,v) with v=(q1,q2,q3). | |
REAL | mQ3 |
The components of the quaternion z=(q0,v) with v=(q1,q2,q3). |
It may or may not be a unit quaternion.
|
Re-normalize the quaternion to unity. This should not be useful, except on individual component input, or after long calculations. And even if wrong, the rotation is independent of the norm of the quaternion. |