|
A single unit quaternion describes one orientation relation. Real systems, however, almost always involve a sequence of rotations or frame transformations. A body may receive several attitude commands, a navigation algorithm may transform through several coordinate frames, or an Euler sequence may build an orientation through three successive elementary rotations.
The important question is therefore not merely how to construct one quaternion, but how quaternion transformations compose and which factor acts first.
PhysicsLibrary uses passive frame quaternions as the canonical attitude objects. If
maps coordinates from frame into frame , and
maps coordinates from frame into frame , then the direct map from into is
 |
(1) |
This is the fundamental PhysicsLibrary composition rule.
The same written order appears for passive direction cosine matrices:
 |
(2) |
The frame labels provide the safest guide to multiplication order. Reading from right to left, the coordinate map proceeds
Quaternion multiplication is associative but not commutative. Therefore two finite rotations generally cannot be exchanged:
 |
(3) |
This noncommutativity is not an abstract inconvenience. It changes the final physical orientation and the transformed vector coordinates.
PhysicsLibrary uses Hamilton multiplication,
with reversed products changing sign.
Quaternion components are displayed scalar first:
 |
(4) |
For a positive frame rotation through angle about unit axis
, the passive elementary quaternion is
 |
(5) |
The passive coordinate action is
 |
(6) |
The corresponding positive active rotor is the conjugate,
 |
(7) |
Hamilton multiplication itself is unchanged by choosing an active or passive interpretation.
Suppose the first coordinate transformation is
Now transform the same physical vector from frame into frame :
 |
(9) |
Substitute equation (8) into equation (9):
Associativity allows the factors to be regrouped:
Quaternion conjugation reverses product order:
 |
(10) |
Therefore
 |
(11) |
Comparing this with the canonical passive sandwich gives
No ad hoc reversal rule is needed. The composition order follows directly from the frame map definition.
The same rule extends immediately to any number of frames. For
the direct quaternion is
 |
(13) |
Applied to a vector,
The factor nearest the vector describes the first coordinate map. Each successive map appears farther to the left.
The frame labels provide a visual consistency check:
The adjacent frame names form the chain
The labels are not algebraically cancelled like scalar fractions, but their pattern is an effective mnemonic for detecting an incorrectly ordered chain.
Starting with
take the inverse:
Since frame quaternions are unit,
Relabeling the reverse maps gives
 |
(14) |
Thus reversing the frame chain also reverses the multiplication order.
The forward sequence
becomes
Let
 |
(15) |
be the passive direction cosine matrix associated with the frame quaternion.
Then
 |
(16) |
Two successive frame maps give
Therefore
Comparing with equation (13) gives the homomorphism relation
 |
(18) |
Quaternion and matrix chains therefore use the same written order under the PhysicsLibrary passive convention.
This alignment is one of the main reasons for choosing the present frame quaternion notation.
Consider the elementary passive quaternions for positive frame rotations about the coordinate and axes:
 |
(19) |
 |
(20) |
Their products are
while
Therefore
 |
(21) |
The sign of the component changes.
Use the initial pure quaternion
Apply first and then . The combined passive operator is
The first map sends
and the second leaves unchanged because it lies along the second rotation axis. Thus
 |
(22) |
Reverse the order. The combined operator is
The map first sends
and the subsequent map leaves unchanged. Hence
 |
(23) |
The same initial vector therefore gives two different final coordinate vectors:
This is a direct observable consequence of noncommutativity.
Figure: Order matters for successive passive frame rotations. Starting with
, applying the positive passive frame map first and the positive passive frame map second gives
and
. Reversing the order gives
and
.
|
|
Figure summarizes both quaternion products and their different actions on the same initial coordinate vector.
Quaternion multiplication is associative:
 |
(24) |
This means parentheses may be moved without changing a valid composition chain.
Quaternion multiplication is not commutative:
 |
(25) |
in general.
These two facts have different practical meanings:
- Associativity allows a long frame chain to be grouped for computational convenience.
- Noncommutativity means the chronological or frame sequence itself cannot normally be rearranged.
The active counterpart obeys the same basic product pattern.
Let actively rotate a physical vector first and let act second:
and
Substitution gives
Therefore
 |
(26) |
The important distinction is not the abstract product law. It is the quaternion associated with a positive geometric rotation.
For the same positive axis and angle,
 |
(27) |
Thus a positive active rotor has the opposite vector sign from the corresponding positive passive frame quaternion.
It is tempting to memorize statements such as “active reverses order” or “passive keeps order.” Such slogans are unreliable because authors define their quaternion symbols, map directions, and axis descriptions differently.
The safe procedure is:
- state what each quaternion maps;
- write the action on a vector;
- substitute successive transformations;
- use associativity;
- identify the resulting net quaternion.
For PhysicsLibrary's canonical passive notation, this procedure yields
The words intrinsic and extrinsic describe which axes are used for successive elementary rotations.
An intrinsic sequence uses axes attached to the moving frame. After the first rotation, the second axis has moved with the frame; after the second rotation, the third axis has moved again.
An extrinsic sequence uses axes fixed in the reference frame.
The same final orientation can be described either way if the axis sequence and angle order are reversed appropriately. Therefore the words alone are not sufficient to determine quaternion multiplication order.
PhysicsLibrary uses intrinsic moving axis language for Euler sequences unless an article explicitly states otherwise.
Let an intrinsic sequence consist of:
- a rotation
about the initial moving axis ;
- a rotation
about the new moving axis ;
- a rotation
about the final moving axis .
Define the passive elementary quaternions
 |
(28) |
 |
(29) |
and
 |
(30) |
Under the PhysicsLibrary moving axis convention, the total passive frame quaternion is
 |
(31) |
The corresponding passive DCM is
 |
(32) |
Quaternion and DCM sequence order therefore agree exactly.
The intrinsic sequence
with angles
describes the same final orientation as an extrinsic sequence about the fixed axes
then then
with angles
Symbolically,
 |
(33) |
This equivalence is a statement about how the same geometric orientation is described. It does not mean the original sequence can be arbitrarily reordered.
For the common intrinsic -- sequence, PhysicsLibrary uses
The rotations occur intrinsically as
The passive quaternion is
 |
(34) |
The passive DCM uses the same order:
 |
(35) |
This is equivalent to an extrinsic fixed axis -- description with angles
applied in the corresponding reversed viewpoint.
Writing the product explicitly is safer than relying on the phrase “yaw pitch roll,” because software and textbooks differ in how they use that phrase.
Let
Hamilton multiplication gives
 |
(36) |
This formula is useful for computing the net axis angle representation after two rotations.
For passive elementary rotations,
and
Thus the scalar part of the net quaternion is
 |
(37) |
where
The vector part is
Once
is normalized and its principal sign is selected, the passive net axis can be recovered from
 |
(39) |
when the vector part is nonzero.
Let both passive rotations use the same unit axis
:
Because both quaternions lie in the same two dimensional subalgebra generated by and
, they commute.
Direct multiplication gives
 |
(40) |
Therefore rotations about the same axis add their angles.
This is a special commuting case. It should not be generalized to rotations about different axes.
If
then
 |
(41) |
The second transformation exactly reverses the first.
For a frame chain,
This is an important implementation check.
Finite rotations do not generally commute, but very small rotations can appear to commute to first order.
Let
and
where the rotation vectors are pure quaternions.
Multiplying and retaining terms through second order gives
Reversing the order changes only the second order product term.
The difference is related to the cross product:
 |
(42) |
Thus noncommutativity disappears only at first order. This is why infinitesimal rotation calculations may look commutative even though finite attitude updates are not.
When composing quaternion transformations in software:
- Document what the quaternion maps. For PhysicsLibrary,
means coordinates
.
- Document Hamilton multiplication separately from component storage.
- Write frame labels in design notes even if the software type does not encode them.
- Build long chains in the same order as the corresponding passive DCM chain.
- Do not reorder factors for computational convenience unless the quaternions are known to commute.
- When converting from an external library, test a positive rotation about each coordinate axis.
- Verify the inverse relation
- For an Euler sequence, write whether the axes are intrinsic moving axes or extrinsic fixed axes.
- Using the old PhysicsLibrary frame notation direction.
The current house convention is
- Reversing a valid frame chain.
The correct chain is
- Assuming finite rotations commute.
In general,
- Confusing active and passive positive rotation quaternions.
For the same positive axis and angle, they are conjugates.
- Changing Hamilton multiplication to repair a frame convention problem.
PhysicsLibrary retains Hamilton multiplication. Frame direction is encoded in the quaternion symbol and in the sign of the positive passive elementary rotation.
- Treating intrinsic and extrinsic as synonyms.
Intrinsic axes move with the rotating frame. Extrinsic axes remain fixed in the reference frame.
- Using an intrinsic axis list with an extrinsic product.
For PhysicsLibrary's intrinsic -- sequence,
- Inferring multiplication convention from scalar first or scalar last storage.
Memory layout does not determine quaternion multiplication.
- Assuming small angle commutativity holds for finite updates.
The noncommuting cross product term appears at second order and becomes important as rotation increments grow.
Several composition checks are useful to keep in a test suite.
- identity on either side:
- Inverse pair:
- Same axis rotations add angles.
- Positive passive and maps do not commute.
- Replacing every quaternion in a complete sandwich by its negative does not change the represented orientation.
- Quaternion and DCM chains produce the same final vector coordinates.
- Intrinsic -- quaternion and DCM products use the same written factor order.
The preceding article, rotating vectors with quaternions, establishes the canonical passive sandwich
The present article uses that action to derive the composition rule, frame chains, noncommutativity, and intrinsic sequence order.
A separate companion entry, Composition of Rotations and Quaternion Order: Examples, Exercises, and Solutions, provides the Q08E self study problem bank.
The next main article, quaternions and direction cosine matrices, derives the complete matrix associated with a unit quaternion and develops the inverse matrix to quaternion conversion.
Quaternion composition follows directly from associativity and the conjugate order reversal identity. Historical quaternion texts treat products of versors and successive rotations, while modern engineering sources emphasize the need to state multiplication and frame conventions explicitly.
Sommer and coauthors provide a modern discussion of Hamilton and flipped multiplication and the homomorphism issues that arise when active and passive attitude conventions are mixed. PhysicsLibrary retains Hamilton multiplication and chooses passive frame quaternions whose composition order matches the passive direction cosine matrix chain.
- 1
- W. R. Hamilton, Elements of Quaternions, 2nd ed., edited by C. J. Joly, Longmans, Green, and Co., 1899. Public domain historical source. Internet Archive scan https://archive.org/details/elementsofquater01hamiuoft
- 2
- C. J. Joly, A Manual of Quaternions, Macmillan and Co., London, 1905. Public domain historical source. Internet Archive scan https://archive.org/details/manualofquaterni00jolyrich
- 3
- A. S. Hathaway, A Primer of Quaternions, 1896. Public domain historical source. Project Gutenberg edition https://www.gutenberg.org/ebooks/9934
- 4
- H. Sommer, I. Gilitschenski, M. Bloesch, S. Weiss, R. Siegwart, and J. Nieto, “Why and How to Avoid the Flipped Quaternion Multiplication,” Aerospace, vol. 5, no. 3, article 72, 2018. Published under CC BY 4.0. Publisher article https://www.mdpi.com/2226-4310/5/3/72
Unless otherwise noted, this PhysicsLibrary entry is intended for release under the Creative Commons Attribution ShareAlike 4.0 International license.
|