Quaternions
Definition
A quaternion is an extended number system for complex numbers. It is represented as a four-element vector:
where is the real scalar part and are the real components of the quaternion vector part.
A unit quaternion can be used to represent the attitude of a rigid body or a rotation transformation. The rotation axis is encoded in the vector part and the rotation angle in the scalar part, through the relationship:
where , , are the angles between the rotation axis vector and the , , axes respectively, and is the rotation angle around the rotation axis vector.
The unit constraint requires .
Quaternion Transformations
With rotations, reversing the axis of rotation or reversing the angle of rotation reverses the transformation. Reversing both at the same time leaves the total transformation unchanged. This gives four related quaternion transformations:
Both and represent the same physical rotation. This double cover of is an inherent property of unit quaternions.
Vector Rotation
Consider a vector , with being the vector in frame and being the same vector in frame . The rotation is applied using the sandwich product:
where is the unit quaternion representing the rotation between and .
Quaternion to DCM
The quaternion rotation relationship can be expanded to give the equivalent DCM in terms of quaternion components:
DCM to Quaternion
The reverse mapping is more involved. Inspection of the DCM yields four candidate mappings:
The correct mapping to use is selected based on which expression gives a non-zero denominator:
Euler Angles to Quaternion
The conversion from Euler angles to a unit quaternion follows the same approach as generating a DCM from Euler angles — chain successive single-axis quaternion rotations:
The single-axis quaternion rotations are:
For the XYZ sequence this gives:
where and .
Quaternion to Euler Angles
The conversion to XYZ Euler angles from a unit quaternion is found by substituting the quaternion-to-DCM conversion into the DCM-to-Euler conversion:
Properties Summary
| Property | Value |
|---|---|
| Parameters | 4 |
| Constraints | 1 (unit norm) |
| Singularities | None |
| Unique representation | No — and are equivalent |
| Inverse | Conjugate |
| Preferred use | Propagation, integration, filtering |