|
A unit quaternion can act directly on an ordinary three-dimensional vector. The vector is first regarded as a pure quaternion, the unit quaternion is applied on one side, and its conjugate is applied on the other. For the PhysicsLibrary convention, the active rotation law is
 |
(1) |
Here is a unit quaternion, is a pure quaternion representing a three-dimensional vector, and
is the rotated vector.
This compact formula is useful because the same quaternion can rotate any vector without introducing Euler angles. It also preserves vector length and is equivalent to the familiar Rodrigues rotation formula.
This entry uses Hamilton multiplication in a right-handed Cartesian frame:
Positive rotation follows the right-hand screw rule. Quaternion components are displayed scalar first,
 |
(2) |
Scalar-last arrays such as
are also common in software. They change only the storage order. They do not change Hamilton multiplication or the physical rotation represented by .
For a rotation through angle about the unit axis
, the unit quaternion is
 |
(3) |
Because
,
 |
(4) |
Let the ordinary vector be
In quaternion algebra it is represented by the pure quaternion
 |
(5) |
whose scalar part is zero. In scalar-first component form this is
 |
(6) |
The same geometric vector remains three-dimensional. The leading zero is only needed when the vector is inserted into quaternion multiplication.
Let
 |
(7) |
Then
 |
(8) |
The active rotation is
 |
(9) |
The expression is sometimes called a sandwich product because the vector appears between and .
Figure shows the geometry. The component of the vector parallel to the rotation axis remains fixed, while the perpendicular component moves around the axis through angle .
Figure: Quaternion rotation of a vector about the unit axis
. The parallel component
is unchanged. The perpendicular component rotates through , carrying to
.
|
|
The scalar–vector form of the Hamilton product is
 |
(10) |
Write
The first multiplication gives
 |
(11) |
Multiplying this result by
causes the scalar part to cancel. The result is again a pure quaternion, so a three-dimensional vector has been mapped to another three-dimensional vector. The vector part becomes
Using the half-angle identities
 |
(13) |
we obtain
 |
(14) |
This is Rodrigues' rotation formula.
The quaternion formula and Rodrigues' formula therefore describe the same rotation. The quaternion form packages the rotation into multiplication, while Rodrigues' formula displays the vector geometry explicitly.
Decompose the vector into components parallel and perpendicular to the axis:
 |
(15) |
 |
(16) |
Because
Rodrigues' formula can be written as
 |
(17) |
This form makes the geometry immediate. Rotation leaves
unchanged and performs an ordinary planar rotation on
in the plane perpendicular to
.
For software, write the unit quaternion as
 |
(18) |
where is the three-component vector part. Expanding the sandwich product gives the equivalent formula
 |
(19) |
This form avoids constructing the intermediate pure quaternion explicitly and is often convenient in numerical code.
An equivalent two-step implementation is
 |
(20) |
 |
(21) |
The formula assumes that is unit and that the Hamilton active-rotation convention used in this entry is being followed.
Several simple cases are useful for checking both derivations and software.
For ,
so
 |
(22) |
If
then
and Rodrigues' formula gives
 |
(23) |
The rotation axis is therefore a fixed direction.
The inverse active rotation is obtained with
:
 |
(24) |
Thus exchanging and reverses the physical rotation angle.
The two unit quaternions and give the same rotation because
 |
(25) |
For a positive rotation about ,
 |
(26) |
Let
Then
Multiplying by
gives
 |
(28) |
Thus
which is the expected right-handed positive rotation about .
Equation (1) is an active rotation. The coordinate frame is held fixed while the physical vector is rotated.
If instead the physical vector is fixed and the coordinate frame is rotated by the same positive orientation represented by , the coordinates transform with the inverse action:
 |
(29) |
For example, a fixed vector along has coordinates in the original frame. After the coordinate axes are rotated about , its new coordinates are
This is not a contradiction. Active vector rotation and passive coordinate change are inverse operations.
If is unit, conjugate and inverse are identical and equation (1) preserves vector magnitude. Using multiplicativity of the quaternion norm,
If a nonunit quaternion is inserted into
, the result is scaled by
. In numerical work, normalize the orientation quaternion before applying the conjugate form, or use the true inverse if a general nonzero quaternion is intentionally being used.
- Forgetting the zero scalar part of a vector. A three-dimensional vector enters quaternion multiplication as
in scalar-first layout.
- Using
when the intended operation is the active rotation in equation (1). Under the convention used here, that expression performs the inverse rotation.
- Using a nonunit quaternion with the conjugate formula. For nonunit , the conjugate is not the inverse.
- Confusing frame handedness with component storage. A right-handed frame describes the orientation of the physical basis. Scalar-first and scalar-last describe only where the scalar component appears in an array.
- Changing scalar-first to scalar-last without changing software indices. The quaternion is the same mathematical object, but code must read the scalar and vector parts from the correct positions.
- Changing a sign to match another source before checking its rotation convention. The sign may arise from active versus passive interpretation, map direction, or a different multiplication convention.
This entry establishes how one unit quaternion acts on one vector. The next PhysicsLibrary article develops composition of finite rotations and explains why the order of quaternion multiplication matters. That discussion will use the same sandwich action to show how two successive rotations combine into one unit quaternion.
A separate companion entry, Rotating Vectors with Quaternions: Examples, Exercises, and Solutions, provides a self-study problem set. All exercises are stated before the solutions.
Hathaway's A Primer of Quaternions gives the classical rotator
and states that a quaternion of angle rotates the represented object through . Joly likewise states that a conical rotation about the axis of through double the quaternion angle changes an arbitrary vector into
. Joly also gives rigid-body examples using this transformation. These public-domain sources provide direct historical support for the sandwich action.
Macfarlane develops finite rotations and their composition using half-angle versors, while Moore gives modern engineering treatment of right-handed reference frames, orientations, and direction-cosine matrices. The notation, Rodrigues derivation, computational formulas, examples, and engineering organization in this entry are newly written for PhysicsLibrary.
- 1
- C. J. Joly, A Manual of Quaternions, Macmillan and Co., London, 1905. Public-domain historical source.
- 2
- A. S. Hathaway, A Primer of Quaternions, 1896. Public-domain text; Project Gutenberg edition and LATEX source available. Project Gutenberg edition
- 3
- A. Macfarlane, Vector Analysis and Quaternions, John Wiley & Sons, New York, 1906. Public-domain historical source; Project Gutenberg edition available. Project Gutenberg edition
- 4
- J. K. Moore, Learn Multibody Dynamics, 2026 edition, especially the chapter “Orientation of Reference Frames.” Creative Commons Attribution 4.0 International. Learn Multibody Dynamics
Unless otherwise noted, this PhysicsLibrary entry is intended for release under the Creative Commons Attribution–ShareAlike 4.0 International license.
|