Quaternion Product in Scalar Vector Form
The component formula for multiplying two quaternions is correct but can look like a collection of
unrelated signs. A more revealing form separates each quaternion into a scalar part and a three
dimensional vector part. In that notation the Hamilton product becomes a compact combination of
the ordinary dot product and cross product.
Let
where pw and qw are real scalars and p and q are pure quaternions identified with ordinary three
dimensional vectors. The Hamilton product is
Equivalently, writing a quaternion as the ordered pair (qw,q),
Equation (2) is one of the most useful quaternion formulas in physics and engineering. It exposes
the geometric content of Hamilton multiplication and makes the sign convention immediately
visible: the PhysicsLibrary Hamilton product contains the term +p × q.
The later PhysicsLibrary attitude articles use passive coordinate transformations. That application
convention does not change equation (2). Hamilton algebra and active or passive attitude
interpretation are separate choices.
1 Convention declaration
PhysicsLibrary uses Hamilton multiplication,
with reversed products changing sign. Quaternions are displayed scalar first:
where
The product convention is determined by the algebra, not by whether software stores the scalar
component first or last.
For comparison, a flipped multiplication used in some engineering literature reverses the Hamilton
factors. Its scalar vector formula contains −p × q instead of the plus sign in equation
(2). PhysicsLibrary does not use that multiplication unless an article explicitly states
otherwise.
2 Product of two pure quaternions
The key result behind equation (2) is the product of two pure quaternions.
Let
and
Expand without changing the factor order:
Using the Hamilton basis products gives the scalar part
and the vector part
which is exactly a × b.
Therefore
Equation (4) is the central bridge between Hamilton quaternion multiplication and ordinary vector
analysis.
3 Deriving the general scalar vector product
Write
Distributivity gives
Real scalars commute with quaternion factors, so
Using equation (4),
Therefore
Separating scalar and vector parts gives
and
Together, equations (5) and (6) reproduce equation (2).
4 Connection to the component formula
Let
The dot product is
and the cross product is
Substitution into equations (5) and (6) gives
Thus the compact scalar vector formula and the four component formula are exactly
equivalent.
5 Geometric meaning of the pure quaternion product
Equation (4),
contains both the metric and oriented geometry of three dimensional Euclidean space.
If γ is the angle from a to b, then
and
Therefore the scalar part of ab contains the negative cosine information, while the vector part
contains the oriented sine information.
This is why quaternion multiplication is naturally sensitive to order: the dot product is
symmetric,
but the cross product is antisymmetric,
6 Reversing the product
From equation (2),
Reversing the order gives
The scalar parts are identical. The difference lies entirely in the sign of the cross product.
Subtracting gives the commutator
The commutator is therefore always a pure quaternion.
Adding the two products gives
The cross product cancels from the symmetric combination.
7 When do two quaternions commute?
Equation (9) gives an immediate condition:
Thus two quaternions commute exactly when their vector parts are parallel, antiparallel, or one
vector part is zero.
For example, every pair of quaternions of the form
with the same fixed unit pure quaternion u, commute with each other. They form a two
dimensional subalgebra isomorphic to the complex numbers.
8 Important special cases
Real scalar times a quaternion
If p = (a,0), then
This is ordinary real scalar multiplication.
Two pure quaternions
If p = (0,p) and q = (0,q), then
A pure quaternion squared
Set q = p. Because
equation (12) gives
Therefore every unit pure quaternion satisfies
This result is fundamental to the later axis angle exponential.
Parallel pure quaternions
If b = λa, then
Hence
which is purely real.
Perpendicular pure quaternions
If
then
which is pure.
For example,
Reversing the factors gives
9 Hamilton and flipped multiplication
The sign of the cross product is a direct convention diagnostic.
PhysicsLibrary Hamilton multiplication uses
If another source defines a flipped product by reversing Hamilton factors,
then its scalar vector form is
Therefore
identifies Hamilton multiplication and
identifies the reversed product when all other definitions are held fixed.
This algebraic distinction must not be confused with the later choice between active and passive
attitude interpretation. PhysicsLibrary retains equation (16) while using passive coordinate
transformations for attitude.
10 Worked example 1: product from scalar and vector parts
Let
Then
and
The dot product is
The cross product is
The scalar part is
The vector part is
Therefore
This agrees with the component calculation in the preceding PhysicsLibrary article, quaternion
definition and basic algebra.
11 Worked example 2: pure quaternion product
Let
Their dot product is
and their cross product is
Therefore
Reversing the factors keeps the scalar part and reverses the vector part:
12 Worked example 3: recovering the basis rule
Take
Because the two unit vectors are perpendicular,
and
Equation (4) gives
Thus the familiar Hamilton basis rule is contained directly in the scalar vector product.
13 Common pitfalls
- Using the wrong sign on the cross product. PhysicsLibrary uses Hamilton
multiplication, so the vector part contains +p × q.
- Forgetting the minus sign on the dot product. For pure quaternions, ab =
−a ⋅ b + a × b.
- Treating quaternion multiplication as componentwise multiplication. The
dot and cross products couple all three vector components.
- Assuming the product of two pure quaternions is pure. Its scalar part is
generally −a ⋅ b.
- Assuming the product of two pure quaternions is real. Its vector part is
generally a × b.
- Interchanging factors. Reversing the factors reverses the cross product and therefore
generally changes the quaternion.
- Confusing storage order with multiplication convention. A scalar last array
can still use Hamilton multiplication.
- Changing the cross product sign because the attitude convention is passive.
The passive PhysicsLibrary attitude convention does not alter Hamilton multiplication.
14 Exercises
The exercises are stated first so the article can be used for self study. Complete solutions follow
afterward.
- Derive the pure product. Starting from the Hamilton basis products, derive
- Scalar vector product. Let
Compute pq using equation (2).
- Reverse the order. For the quaternions in Exercise 2, compute qp without repeating
the complete calculation. Use the symmetry of the dot product and antisymmetry of
the cross product.
- Pure quaternion square. Prove from equation (4) that
- Unit pure quaternion. If ∥u∥ = 1, prove that u2 = −1.
- Perpendicular vectors. Let a ⋅ b = 0. Show that
and
- Parallel vectors. If b = λa, show that ab is purely real.
- Commutator. Derive
- Commuting quaternions. Use Exercise 8 to prove that p and q commute if and only
if their vector parts are parallel, antiparallel, or one is zero.
- Convention diagnostic. A source states
Does ⋆ agree with PhysicsLibrary Hamilton multiplication? Explain.
15 Solutions
1. Derive the pure product
Expand
and
The square terms contribute
The mixed basis terms contribute
which is a × b. Therefore
2. Scalar vector product
For
and
we have
and
Thus the scalar part is −7, and the vector part is
Therefore
3. Reverse the order
The scalar part remains −7. Reversing the factors changes
to
Therefore
4. Pure quaternion square
Set b = a in equation (4):
Since
and
we obtain
5. Unit pure quaternion
If ∥u∥ = 1, Exercise 4 gives immediately
6. Perpendicular vectors
If
then
Reversing the factors gives
7. Parallel vectors
If
then
Therefore
which is purely real.
8. Commutator
Use equations (2) and (8). The scalar parts cancel, as do the terms pwq + qwp. The cross terms
give
Hence
9. Commuting quaternions
The quaternions commute exactly when
By Exercise 8 this is equivalent to
A cross product vanishes exactly when the two vectors are parallel, antiparallel, or one is
zero.
10. Convention diagnostic
The operation ⋆ does not agree with PhysicsLibrary Hamilton multiplication because its vector
part contains
PhysicsLibrary Hamilton multiplication contains
The sign difference identifies a reversed or flipped multiplication when the remaining definitions are
held fixed. It is not caused by scalar first or scalar last storage, and it is not caused by the later
passive attitude interpretation.
16 What comes next
The scalar vector form makes several later quaternion identities almost automatic.
For the conjugate,
equation (2) immediately shows why
is purely real: the cross product of q with itself vanishes. That result leads directly to the
quaternion norm and inverse.
The later orientation articles use the same Hamilton product to construct passive frame
transformations. No algebraic sign in equation (2) is changed when the application changes from
general quaternion algebra to passive attitude representation.
17 Sources and historical notes
Hamilton’s quaternion algebra contains both scalar and vector parts of products. Later quaternion
and vector analysis texts made the relationship to dot and cross products increasingly explicit.
Joly’s A Manual of Quaternions and Macfarlane’s Vector Analysis and Quaternions are useful
public domain historical references for this decomposition.
The modern PhysicsLibrary notation uses ordinary dot and cross product symbols and scalar first
quaternion components. The exposition and worked examples in this entry are newly organized for
physics and engineering use.
References
[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
[2] C. J. Joly, A Manual of Quaternions, Macmillan and Co., London, 1905. Public
domain historical source. Internet Archive scan
[3] A. Macfarlane, Vector Analysis and Quaternions, John Wiley and Sons, New York,
1906. Public domain historical source. Project Gutenberg edition
[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
License
Unless otherwise noted, this PhysicsLibrary entry is intended for release under the Creative
Commons Attribution ShareAlike 4.0 International license.