|
A three dimensional rigid body rotation can be described by an axis and an angle. The axis is a unit vector
that remains fixed by the rotation, and the angle specifies how far the body or vector is rotated about that axis. Unit quaternions encode exactly this axis angle information in a compact algebraic form.
For the PhysicsLibrary convention, a positive active rotation through angle about the right-hand rule unit axis
is represented by
 |
(1) |
The appearance of the half angle is fundamental. It is not a storage convention and it is not an arbitrary factor inserted for convenience. It follows from the way a unit quaternion acts on three dimensional vectors.
This entry develops the axis angle form and explains the half angle. The next PhysicsLibrary entry derives the full vector rotation formula
and its equivalence to Rodrigues' rotation formula.
Unless explicitly stated otherwise, this entry uses Hamilton multiplication,
with reversed products changing sign. Physical Cartesian frames are right-handed, positive rotation follows the right-hand screw rule, and quaternion components are displayed scalar first:
 |
(2) |
Scalar-first versus scalar-last storage is only a component layout choice; it does not change the quaternion multiplication law or the physical rotation.
Euler's finite rotation result states that any proper rigid rotation in three dimensions can be represented by a rotation through some angle about some axis. Let
 |
(3) |
The vector
is identified with a pure quaternion. Because it is a unit pure quaternion,
 |
(4) |
Thus an arbitrary spatial unit axis behaves algebraically like an imaginary unit.
The pair
is called an axis angle representation of the rotation. In engineering the same information is often packaged into the rotation vector
 |
(5) |
The direction of
is the Euler axis and its magnitude is the rotation angle.
Since
, the power series expansion of the quaternion exponential separates into even and odd powers exactly as it does for the complex exponential:
 |
(6) |
Indeed,
Therefore a quaternion of the form
 |
(7) |
has unit norm, because
Hence is a unit quaternion, and
 |
(9) |
The half angle can be seen with a minimal rotation calculation. Let be a unit vector perpendicular to the proposed rotation axis
, and define
 |
(10) |
For Hamilton multiplication and perpendicular pure quaternions,
Now write
 |
(11) |
where
and
. Since is unit,
. Acting on the perpendicular test vector gives
Using the double angle identities,
 |
(13) |
The vector has therefore rotated in the plane perpendicular to
through the physical angle
 |
(14) |
Consequently the unit quaternion that represents a physical rotation through must use
 |
(15) |
This limited perpendicular vector calculation establishes the half angle. The next article carries out the general calculation for an arbitrary vector with components both parallel and perpendicular to the rotation axis.
With
equation (14) becomes
 |
(16) |
Thus
 |
(17) |
The vector part points along the rotation axis, while its magnitude is the sine of half the rotation angle.
Suppose
 |
(18) |
Define
 |
(19) |
A numerically useful extraction is
 |
(20) |
When , the axis is
 |
(21) |
The equivalent expression
is common, but
uses both scalar and vector information and is generally preferable in numerical software. The quaternion should be normalized before extracting an angle.
If a principal rotation with
is desired, a common engineering choice is first to replace by when . This chooses the representative with nonnegative scalar part and therefore selects the shorter of the two equivalent rotation angles.
A unit quaternion and its negative represent the same physical orientation. The vector rotation action satisfies
 |
(22) |
Therefore the mapping from unit quaternions to physical rotations is two-to-one. This is the practical source of the familiar sign ambiguity in attitude data.
The axis angle form makes the same fact visible. Increasing the physical angle by gives
A further returns to the same quaternion:
 |
(24) |
The deeper and interpretation of this double covering belongs to the later mathematical branch of the PhysicsLibrary quaternion sequence.
For ,
 |
(25) |
The axis is physically irrelevant and therefore undefined. This is why axis extraction becomes ill-conditioned when the vector part of the quaternion is very small.
For
,
 |
(26) |
The scalar part is zero. Both
and
represent the same physical rotation because the corresponding quaternions differ only by sign.
For
,
 |
(27) |
This is the same physical orientation as , although the quaternion itself has changed sign.
Let the rotation vector be
For a small rotation,
rad,
Therefore
 |
(28) |
when the rotation vector is identified with a pure quaternion. In scalar-first components,
 |
(29) |
This approximation is ubiquitous in attitude-error Kalman filters and local linearizations. It is a first-order approximation; the quaternion should not be assumed to have exactly unit norm after arbitrary finite updates unless it is renormalized or constructed with the exact trigonometric formula.
Equation (14) is the PhysicsLibrary formula for a positive active rotation. If actively rotates vectors by about
, then
 |
(30) |
represents the inverse active rotation, namely about the same axis. The same inverse quaternion also appears when the corresponding transformation is interpreted passively as a coordinate change in the opposite direction.
This sign change must not be confused with scalar-first versus scalar-last storage or with Hamilton versus flipped quaternion multiplication. Those are separate convention choices established in the PhysicsLibrary convention entry.
- Forgetting to normalize the axis. The vector
in equation (14) must have unit length.
- Using the full angle inside the sine and cosine. The quaternion phase is
because the sandwich action produces twice that angle.
- Treating
and as different orientations. They are distinct points on the unit-quaternion sphere but represent the same physical rotation.
- Extracting an axis at zero rotation. When
, the rotation axis is physically indeterminate and numerically poorly conditioned.
- Using
as an inverse for a nonunit quaternion. The identity
holds only when
.
- Changing signs to match another source without checking its convention. Active/passive interpretation, frame direction, and Hamilton/flipped multiplication can each alter the appearance of formulas.
The axis angle formula produces the unit quaternion associated with a finite rotation. The next PhysicsLibrary article, Rotating Vectors with Quaternions, derives the general action
and reduces it to Rodrigues' rotation formula. That derivation will make the parallel and perpendicular components of an arbitrary vector explicit.
A separate companion entry, Axis Angle Representation and Unit Quaternion: Examples, Exercises, and Solutions, provides a self study problem set with all exercises stated before the solutions.
Hamilton's Elements of Quaternions develops the versor as the unit quaternion carrying axis and angle information. Joly gives an especially clear historical statement that the transformation
rotates vectors about the axis of through twice the quaternion's angle. Hathaway develops finite rotations before introducing quaternions, making the axis angle geometry explicit. Macfarlane similarly uses half-angle versors in the composition of finite rotations. These public domain sources motivate the historical and geometric discussion here. The notation and engineering organization are modernized for PhysicsLibrary.
The PhysicsLibrary convention contract also uses the modern scalar-first Hamilton form
which was established in the preceding convention entry. The existing Q00 source states the same active rotation convention explicitly. The public domain Joly source states that the sandwich transformation produces a rotation through double the quaternion angle, providing a useful historical cross-check of the half-angle derivation.
- 1
- W. R. Hamilton, Elements of Quaternions, 2nd ed., Vol. I, edited by C. J. Joly, Longmans, Green, and Co., London, 1899. Public-domain historical source. Internet Archive copy
- 2
- C. J. Joly, A Manual of Quaternions, Macmillan and Co., London, 1905. Public-domain historical source.
- 3
- A. S. Hathaway, A Primer of Quaternions, 1896. Public-domain text; Project Gutenberg edition and LATEX source available. Project Gutenberg edition
- 4
- A. Macfarlane, Vector Analysis and Quaternions, John Wiley & Sons, New York, 1906. Public-domain historical source; Project Gutenberg edition available. Project Gutenberg edition
Unless otherwise noted, this PhysicsLibrary entry is intended for release under the Creative Commons Attribution–ShareAlike 4.0 International license.
|