|
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 and are real scalars and and are pure quaternions identified with ordinary three dimensional vectors. The Hamilton product is
 |
(1) |
Equivalently, writing a quaternion as the ordered pair
,
 |
(2) |
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
.
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.
PhysicsLibrary uses Hamilton multiplication,
with reversed products changing sign. Quaternions are displayed scalar first:
 |
(3) |
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
instead of the plus sign in equation (2). PhysicsLibrary does not use that multiplication unless an article explicitly states otherwise.
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
.
Therefore
 |
(4) |
Equation (4) is the central bridge between Hamilton quaternion multiplication and ordinary vector analysis.
Write
Distributivity gives
Real scalars commute with quaternion factors, so
Using equation (4),
Therefore
Separating scalar and vector parts gives
 |
(5) |
and
 |
(6) |
Together, equations (5) and (6) reproduce equation (2).
Let
The dot product is
and the cross product is
Substitution into equations (5) and (6) gives
![$\displaystyle [pq]_{\mathrm{PL}} = \begin{bmatrix} p_wq_w-p_xq_x-p_yq_y-p_zq_z\... ..._y\ p_wq_y-p_xq_z+p_yq_w+p_zq_x\ p_wq_z+p_xq_y-p_yq_x+p_zq_w \end{bmatrix}.$ $\displaystyle [pq]_{\mathrm{PL}} = \begin{bmatrix} p_wq_w-p_xq_x-p_yq_y-p_zq_z\... ..._y\ p_wq_y-p_xq_z+p_yq_w+p_zq_x\ p_wq_z+p_xq_y-p_yq_x+p_zq_w \end{bmatrix}.$](https://images.physicslibrary.org/cache/objects/1090/l2h/img31.png) |
(7) |
Thus the compact scalar vector formula and the four component formula are exactly equivalent.
Equation (4),
contains both the metric and oriented geometry of three dimensional Euclidean space.
If is the angle from to , then
and
Therefore the scalar part of
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,
From equation (2),
Reversing the order gives
 |
(8) |
The scalar parts are identical. The difference lies entirely in the sign of the cross product.
Subtracting gives the commutator
![$\displaystyle [p,q] = pq-qp = 2\mathbf p\times\mathbf q.$ $\displaystyle [p,q] = pq-qp = 2\mathbf p\times\mathbf q.$](https://images.physicslibrary.org/cache/objects/1090/l2h/img43.png) |
(9) |
The commutator is therefore always a pure quaternion.
Adding the two products gives
 |
(10) |
The cross product cancels from the symmetric combination.
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 , commute with each other. They form a two dimensional subalgebra isomorphic to the complex numbers.
If
, then
 |
(11) |
This is ordinary real scalar multiplication.
If
and
, then
 |
(12) |
Set
. Because
equation (12) gives
 |
(13) |
Therefore every unit pure quaternion satisfies
This result is fundamental to the later axis angle exponential.
If
, then
Hence
 |
(14) |
which is purely real.
If
then
 |
(15) |
which is pure.
For example,
Reversing the factors gives
The sign of the cross product is a direct convention diagnostic.
PhysicsLibrary Hamilton multiplication uses
 |
(16) |
If another source defines a flipped product by reversing Hamilton factors,
then its scalar vector form is
 |
(17) |
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.
Let
Then
and
The dot product is
The cross product is
The scalar part is
The vector part is
Therefore
 |
(18) |
This agrees with the component calculation in the preceding PhysicsLibrary article, quaternion definition and basic algebra.
Let
Their dot product is
and their cross product is
Therefore
 |
(19) |
Reversing the factors keeps the scalar part and reverses the vector part:
 |
(20) |
Take
Because the two unit vectors are perpendicular,
and
Equation (4) gives
 |
(21) |
Thus the familiar Hamilton basis rule is contained directly in the scalar vector product.
- Using the wrong sign on the cross product. PhysicsLibrary uses Hamilton multiplication, so the vector part contains
.
- Forgetting the minus sign on the dot product. For pure quaternions,
.
- 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
.
- Assuming the product of two pure quaternions is real. Its vector part is generally
.
- 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.
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
using equation (2).
- Reverse the order. For the quaternions in Exercise 2, compute
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
, prove that
.
- Perpendicular vectors. Let
. Show that
and
- Parallel vectors. If
, show that
is purely real.
- Commutator. Derive
- Commuting quaternions. Use Exercise 8 to prove that
and 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.
Expand
and
The square terms contribute
The mixed basis terms contribute
which is
. Therefore
For
and
we have
and
Thus the scalar part is , and the vector part is
Therefore
The scalar part remains . Reversing the factors changes
to
Therefore
Set
in equation (4):
Since
and
we obtain
If
, Exercise 4 gives immediately
If
then
Reversing the factors gives
If
then
Therefore
which is purely real.
Use equations (2) and (8). The scalar parts cancel, as do the terms
. The cross terms give
Hence
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.
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.
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 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.
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.
- 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. Macfarlane, Vector Analysis and Quaternions, John Wiley and Sons, New York, 1906. Public domain historical source. Project Gutenberg edition https://www.gutenberg.org/ebooks/13609
- 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.
|