Axis Angle Representation and Unit Quaternion
A three dimensional rigid body orientation can be described by an axis and an angle. The axis is a
unit vector u that is unchanged by the corresponding rotation, and the angle 𝜃 specifies
the relative rotation of one reference frame with respect to another about that axis.
Unit quaternions encode exactly this axis angle information in a compact algebraic
form.
For the PhysicsLibrary convention, let frame B be obtained from frame A by a positive right hand
rule rotation of the frame axes through angle 𝜃 about the unit axis u. The passive coordinate
map
is represented by
The negative sign in the vector part is fundamental to the passive convention. It is not a storage
convention and does not change Hamilton multiplication. It appears because a positive
rotation of the coordinate frame produces the inverse coordinate motion of a fixed physical
vector.
The appearance of the half angle is equally fundamental. It follows from the two sided quaternion
action on three dimensional vectors.
This entry develops the passive axis angle form, explains the half angle, derives axis and angle
recovery, and connects the result to the equivalent active rotor. The next PhysicsLibrary entry
develops the full passive coordinate transformation formula and its relation to Rodrigues’
formula.
1 Convention declaration
Unless explicitly stated otherwise, this entry uses Hamilton multiplication,
with reversed products changing sign. Physical Cartesian frames are right handed, positive frame
rotation follows the right hand screw rule, and quaternion components are displayed scalar
first:
The canonical PhysicsLibrary attitude quaternion is
which maps coordinates from frame A into frame B:
The inverse frame map is
Scalar first versus scalar last storage is only a component layout choice; it does not change the
quaternion multiplication law, frame map direction, or axis angle sign.
For a detailed comparison of convention choices, see Quaternions for Physics and Engineering:
Orientation, Notation, and Conventions.
2 Axis angle representation
Euler’s finite rotation result states that any proper relative orientation in three dimensions can be
represented by a rotation through some angle 𝜃 about some axis. Let
The geometric axis u is identified with a pure quaternion. Because it is a unit pure
quaternion,
Thus an arbitrary spatial unit axis behaves algebraically like an imaginary unit.
The pair
will mean throughout this article that frame B is obtained from frame A by a positive right
handed rotation through 𝜃 about u.
In engineering the same information is often packaged into the frame rotation vector
Its direction is the Euler axis and its magnitude is the frame rotation angle. Under the
PhysicsLibrary passive quaternion convention, the quaternion vector part points in the opposite
direction from 𝜃 for principal positive rotations.
3 Unit quaternions and quaternion exponentials
Since u2 = −1, the power series expansion of the quaternion exponential separates into even and
odd powers exactly as it does for the complex exponential:
Indeed,
Therefore a quaternion of the form
has unit norm, because
Hence q is a unit quaternion, and
For the passive frame map,
The conjugate,
is both the inverse coordinate map Aq
B and the usual positive angle active rotor associated with
the same relative geometry.
4 Why the quaternion uses half the frame rotation angle
The half angle can be seen with a minimal coordinate transformation calculation. Let v be a unit
vector perpendicular to the rotation axis u, and define
For Hamilton multiplication and perpendicular pure quaternions,
Now write the candidate passive quaternion as
where c = cos ϕ and s = sin ϕ. Since q is unit,
Applying the passive sandwich to the perpendicular test vector gives
Using the double angle identities,
The coordinate representation of the fixed physical vector has therefore rotated through −2ϕ in the
plane perpendicular to u. That is exactly what must occur when the coordinate frame itself rotates
positively through +2ϕ.
Hence the positive frame rotation angle is
Consequently the passive unit quaternion for a positive frame rotation through 𝜃 is
The minus sign determines the passive direction; the factor of one half comes from the two sided
sandwich action.
This perpendicular vector calculation establishes the half angle and the passive sign. The next
article carries out the general coordinate transformation for an arbitrary vector with components
both parallel and perpendicular to the rotation axis.
5 Scalar first component form
With
the passive axis angle quaternion becomes
Thus
For a principal positive frame rotation, the quaternion vector part points opposite the positive
frame rotation axis. This is the passive counterpart of the familiar active rotor, whose vector part
points along +u.
6 Recovering frame axis and angle from a unit quaternion
Suppose
Define
For a principal positive frame rotation with
a numerically useful extraction is
When s≠0, the positive frame rotation axis is
The minus sign is essential under the PhysicsLibrary passive convention.
The equivalent expression
is common, but atan2 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 Bq
A by −Bq
A when qw < 0. This selects
the representative with nonnegative scalar part and therefore chooses the shorter equivalent frame
rotation.
An equally valid alternative is to extract the axis and angle of the coordinate motion rather
than of the positive frame rotation. In that interpretation the coordinate motion axis
is
and the coordinate motion angle is −𝜃. PhysicsLibrary uses the positive frame axis and angle as
the canonical axis angle pair.
7 The sign ambiguity: q and −q
A unit quaternion and its negative represent the same frame to frame coordinate transformation.
The passive action satisfies
Therefore the mapping from unit quaternions to proper frame orientations is two to one. This is
the practical source of the familiar sign ambiguity in attitude data.
The passive axis angle form makes the same fact visible. Increasing the positive frame angle by 2π
gives
A further 2π returns to the same quaternion:
The deeper S3 and SU(2) interpretation of this double covering belongs to the later mathematical
branch of the PhysicsLibrary quaternion sequence.
8 Important special cases
Zero frame rotation
For 𝜃 = 0,
The frames coincide. 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.
Frame rotation through π radians
For 𝜃 = π,
The scalar part is zero. Because q and −q represent the same orientation,
represents the same 180∘ orientation as well. This is consistent with the geometric fact that at
180∘, reversing the axis gives an equivalent axis angle description.
Frame rotation through 2π radians
For 𝜃 = 2π,
This is the same physical frame orientation as Bq
A = +1, although the quaternion itself has
changed sign.
9 Small angle form used in engineering
Let the positive frame rotation vector be
For a small frame rotation, |𝜃|≪ 1 rad,
Therefore the passive frame quaternion satisfies
when the rotation vector is identified with a pure quaternion.
In scalar first components,
This negative sign is important in attitude error filters, inertial navigation, and local frame
linearizations. A formula using
may still be correct, but it is using either the inverse frame map, an active rotation increment, or
an oppositely defined error vector.
The approximation above is first order. The quaternion should not be assumed to have exactly unit
norm after arbitrary finite updates unless it is renormalized or constructed from the exact
trigonometric formula.
10 Passive and active interpretation
The defining equation of this article,
represents a positive frame rotation through +𝜃 about u and acts passively on coordinates:
The conjugate is
The same numerical quaternion also serves as the familiar positive active rotor for rotating a
physical vector through +𝜃 about the same right hand rule axis in a fixed frame:
Equivalently, if
then
For a positive 90∘ rotation of frame B relative to frame A about +z,
A fixed vector with
has coordinates
By contrast, the conjugate active rotor sends a physical +x vector to +y in a fixed
frame.
The 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.
11 Relationship to passive direction cosine matrices
The passive axis angle quaternion is designed to agree directly with the PhysicsLibrary direction
cosine matrix convention.
For the same positive frame rotation,
For a rotation about +z,
corresponding to
At 𝜃 = 90∘ this matrix maps
to
exactly as the quaternion does.
This quaternion DCM agreement is one of the central convention checks used throughout the
revised PhysicsLibrary orientation series.
12 Connection to intrinsic Euler sequences
Axis angle representation describes one finite frame rotation. Euler Angles describe the same final
orientation through a sequence of elementary frame rotations.
PhysicsLibrary interprets named Euler sequences intrinsically. For an intrinsic i–j–k sequence with
successive positive frame angles α,β,γ, define
and similarly for the second and third axes. Frame chaining gives
The corresponding passive DCM is
Thus the quaternion and DCM products have the same factor order.
For the common intrinsic 3–2–1 yaw pitch roll sequence,
where ψ is yaw, 𝜃 is pitch, and ϕ is roll.
13 Common pitfalls
- Forgetting to normalize the axis. The vector u in the passive axis angle formula
must have unit length.
- Using the full angle inside the sine and cosine. The quaternion phase is 𝜃∕2
because the sandwich action produces twice the quaternion phase.
- Using the active sign for a passive frame quaternion. For a positive frame
rotation,
The plus sign belongs to the conjugate active rotor or inverse passive map.
- Extracting the frame axis without the passive minus sign. For the principal
passive quaternion,
- Treating q and −q as different orientations. They are distinct points on the unit
quaternion sphere but represent the same proper frame orientation.
- Extracting an axis at zero rotation. When ∥q∥≈ 0, the rotation axis is physically
indeterminate and numerically poorly conditioned.
- Using q∗ as an inverse for a nonunit quaternion. The identity q−1 = q∗ holds
only when ∥q∥ = 1.
- Changing signs to match another source without checking its convention.
Active/passive interpretation, frame direction, axis angle sign, and Hamilton/flipped
multiplication can each alter the appearance of formulas.
- Assuming a small positive frame rotation gives a positive quaternion vector
part. Under the PhysicsLibrary passive convention,
14 What comes next
The passive axis angle formula produces the unit quaternion associated with a finite frame
orientation. The next PhysicsLibrary article, rotating vectors with quaternions, is being
revised into a frame coordinate transformation article. Under the present convention it
derives
and reduces the vector part to the passive Rodrigues form
with the usual care that all vector quantities in a single algebraic cross product expression must be
resolved in a common basis.
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 and uses the same passive signs established here.
15 Sources and historical notes
Hamilton’s Elements of Quaternions develops the versor as the unit quaternion carrying axis and
angle information. Joly gives a clear historical statement that the transformation q(⋅)q−1 rotates
vectors about the axis of q 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.
Those historical treatments are valuable for understanding the algebraic origin of the half angle,
but their rotation language should not be assumed to match the modern PhysicsLibrary frame
map convention term for term. The revised PhysicsLibrary convention uses the passive scalar first
Hamilton form
Its conjugate,
is the conventional positive active rotor used in many historical and modern derivations. The two
contain the same half angle geometry and represent inverse operations.
The convention itself is established in Quaternions for Physics and Engineering: Orientation,
Notation, and Conventions.
References
[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
License
Unless otherwise noted, this PhysicsLibrary entry is intended for release under the Creative
Commons Attribution ShareAlike 4.0 International license.