|
|
|
Main Menu
|
|
Sections
Meta
Talkback
Downloads
Information
|
|
|
|
|
example of quaternion definition and basic algebra
|
(Example)
|
|
|
This entry is the self study companion to quaternion definition and basic algebra. Its purpose is to build fluency with quaternion notation and Hamilton multiplication before quaternions are used for axis angle rotations, attitude, or angular kinematics.
All exercises are stated first. Complete worked solutions follow afterward.
A quaternion is
 |
(1) |
with real coefficients. PhysicsLibrary displays components scalar first:
![$\displaystyle [q]_{\mathrm{PL}}= \begin{bmatrix} q_w\\ q_x\\ q_y\\ q_z \end{bmatrix}.$ $\displaystyle [q]_{\mathrm{PL}}= \begin{bmatrix} q_w\\ q_x\\ q_y\\ q_z \end{bmatrix}.$](https://images.physicslibrary.org/cache/objects/1114/l2h/img2.png) |
(2) |
The scalar and vector parts are
 |
(3) |
Hamilton's basis rules are
 |
(4) |
 |
(5) |
and reversing two distinct basis factors changes the sign. quaternion multiplication is associative and distributive but not generally commutative.
- Identify quaternion parts.
For
determine
, the scalar part, the vector part, and the PhysicsLibrary scalar first component column. Is pure? Is it a real quaternion?
- Quaternion equality.
Let
Find such that . Explain why a quaternion equality represents four real coefficient equations.
- Addition and scalar multiplication.
Let
Compute , , , and . Verify
.
- Hamilton basis multiplication.
Evaluate
- Derive a cyclic product.
Starting from
derive
using associativity and
. Then derive
in the same spirit.
- Direct general product expansion.
Let
Compute by distributing all terms and using the basis multiplication table.
- Order matters.
Using the same and , compute and the commutator
![$\displaystyle \relax[p,q]=pq-qp.$ $\displaystyle \relax[p,q]=pq-qp.$](https://images.physicslibrary.org/cache/objects/1114/l2h/img29.png) |
(6) |
Do the two quaternions commute?
- A cancellation identity.
Show directly that
 |
(7) |
Explain what incorrect extra term appears if and are treated as commuting symbols.
- Associativity versus commutativity.
Verify explicitly that
but
State what each calculation demonstrates.
- Distributivity.
Let
Compute both sides of
and
.
- Complex subalgebra.
Let
with real . Show
 |
(8) |
and verify for this restricted pair. Explain why this does not imply that all quaternions commute.
- Arbitrary unit pure quaternion.
Let
Expand and prove
 |
(9) |
Why is this result important for later axis based quaternion formulas?
- Pure quaternion product and vector analysis.
Let
Expand and show
 |
(10) |
while the vector part equals
. Use
,
as a sign check.
- Storage order diagnostic.
Package A stores
and Package B stores
. Both use Hamilton multiplication. A student claims Package B must use a different quaternion algebra. Is the claim correct? Write
in the array order expected by both packages.
- Multiplication convention versus attitude convention.
An engineer writes quaternions scalar first and states
A colleague says the minus sign must indicate a passive attitude convention. Evaluate the claim. What does the basis equation actually reveal, and what additional information is required to decide whether an attitude quaternion is active or passive?
For
we have
Therefore
 |
(11) |
and
 |
(12) |
The component column is
![$\displaystyle [q]_{\mathrm{PL}}= \begin{bmatrix} 3\\ -2\\ 5\\ -7 \end{bmatrix}.$ $\displaystyle [q]_{\mathrm{PL}}= \begin{bmatrix} 3\\ -2\\ 5\\ -7 \end{bmatrix}.$](https://images.physicslibrary.org/cache/objects/1114/l2h/img59.png) |
(13) |
A pure quaternion has zero scalar part, so is not pure. A real quaternion has zero vector part, so is not real either.
Equality requires corresponding coefficients to agree. Thus
Hence
 |
(14) |
A quaternion has four independent real coefficients, so one quaternion equality is shorthand for four real equations.
Componentwise addition gives
 |
(15) |
Subtraction gives
 |
(16) |
Also,
 |
(17) |
and
 |
(18) |
Finally,
and direct addition of and gives the same result.
Using the Hamilton table,
Also,
while
Since
,
and
Starting with
right multiply by
:
Associativity gives
Because
,
 |
(19) |
Similarly, left multiply the fundamental relation by
:
Since
,
 |
(20) |
Distribute without changing factor order:
Use
Collecting coefficients gives
 |
(21) |
Reversing the factors gives
 |
(22) |
Therefore
so
![$\displaystyle [p,q]=-8\mathbf i+2\mathbf j+12\mathbf k.$ $\displaystyle [p,q]=-8\mathbf i+2\mathbf j+12\mathbf k.$](https://images.physicslibrary.org/cache/objects/1114/l2h/img93.png) |
(23) |
The commutator is nonzero, so and do not commute.
Expand in factor order:
Thus
Therefore
 |
(24) |
If the basis elements were incorrectly assumed to commute, the middle terms would be combined as
, which is wrong because
.
First,
Also,
Hence associativity holds in this example. But
so commutativity fails. Quaternion factors may be regrouped but not generally reordered.
For the first identity,
Separately,
so
. For the second identity,
Also,
so
.
Multiply directly:
Thus
 |
(25) |
Reversing the factors yields the same expression because the real coefficients commute and only one imaginary basis direction is present. This restricted set is a copy of the complex numbers inside the quaternions. It does not imply that general quaternions commute because different imaginary basis directions do not commute.
Expand
Each mixed pair cancels because reversing distinct Hamilton basis factors changes the sign. Hence
Using
gives
 |
(26) |
Thus every unit pure quaternion behaves algebraically like an imaginary unit. Later, this allows an arbitrary spatial unit axis to appear naturally inside quaternion axis angle formulas.
Expanding gives the scalar terms
so
 |
(27) |
The vector terms are
which is exactly
. Therefore
 |
(28) |
For
and
, the dot product is zero and the cross product is , so the formula gives
as required.
The claim is incorrect. Storage order changes only the order of the four real coefficients in memory or display; it does not change Hamilton multiplication. For Package A,
![$\displaystyle [0.8,-0.1,0.2,-0.55].$ $\displaystyle [0.8,-0.1,0.2,-0.55].$](https://images.physicslibrary.org/cache/objects/1114/l2h/img126.png) |
(29) |
For Package B,
![$\displaystyle [-0.1,0.2,-0.55,0.8].$ $\displaystyle [-0.1,0.2,-0.55,0.8].$](https://images.physicslibrary.org/cache/objects/1114/l2h/img127.png) |
(30) |
The semantic quaternion is identical in both cases.
The colleague's claim is incorrect. The basis equation
identifies a multiplication law whose cross-like basis products are flipped relative to the PhysicsLibrary Hamilton rule
. It does not by itself identify active or passive attitude semantics. Likewise, scalar first notation only specifies coefficient ordering. To determine attitude semantics, one needs the declared physical map, for example an active vector rule such as
or a frame labeled passive coordinate rule such as
Multiplication law, storage order, and attitude interpretation are separate convention choices.
The central facts tested here are
 |
(31) |
 |
(32) |
 |
(33) |
 |
(34) |
and, for pure quaternions,
 |
(35) |
The last identity is the bridge to the next PhysicsLibrary quaternion entry, which develops the scalar vector Hamilton product in compact form.
The exercises and solutions in this companion are newly written or expanded for PhysicsLibrary. Hamilton is the foundational historical source; Joly, Kelland and Tait, and Hathaway provide later systematic and pedagogical treatments. The present article uses modern scalar first engineering notation rather than reproducing historical notation.
- 1
- W. R. Hamilton, Elements of Quaternions, 2nd ed., edited by C. J. Joly, Longmans, Green, and Co., 1899. Internet Archive scan
- 2
- C. J. Joly, A Manual of Quaternions, Macmillan and Co., London, 1905. Internet Archive search
- 3
- P. Kelland and P. G. Tait, Introduction to Quaternions, with Numerous Examples, 2nd ed., Macmillan and Co., London, 1882. Internet Archive search
- 4
- A. S. Hathaway, A Primer of Quaternions, 1896. Project Gutenberg edition
Unless otherwise noted, this PhysicsLibrary entry is intended for release under the Creative Commons Attribution ShareAlike 4.0 International license.
| "example of quaternion definition and basic algebra" is owned by bloftin.(view preamble)
|
|
See Also: quaternion series overview and article guide, Notation Quaternions for Physics and Engineering: Orientation, quaternion definition and basic algebra, quaternion product, example of quaternion product, quaternion conjugate, example of quaternion conjugate, quaternion norm, example of quaternion norm, quaternion inverse, example of quaternion inverse, Axis Angle Representation and Unit Quaternion, example of Axis Angle Representation and Unit Quaternion, rotating vectors with quaternions, example of rotating vectors with quaternions, composition of rotations and quaternion order, example of composition of rotations and quaternion order, quaternions and direction cosine matrices, example of quaternions and direction cosine matrices, quaternions and Euler angles, example of quaternions and Euler angles, quaternion kinematics and angular velocity, example of quaternion kinematics and angular velocity, relative attitude and error quaternions, example of relative attitude and error quaternions, numerical quaternion propagation and IMU attitude state integration, example of numerical quaternion propagation and IMU attitude state integration, quaternion exercises for physics and engineering
| Keywords: |
exercises, worked solutions, quaternion, Hamilton quaternion, quaternion algebra, scalar part, vector part, pure quaternion, Hamilton product, noncommutative algebra, associative algebra, division algebra, quaternion multiplication table |
This object's parent.
Cross-references: cross product, dot product, relation, formulas, commutativity, identity, commute, commutator, quaternion multiplication, vector, scalar, kinematics, quaternion, quaternion definition and basic algebra
There is 1 reference to this object.
This is version 3 of example of quaternion definition and basic algebra, born on 2026-08-28, modified 2026-08-28.
Object id is 1114, canonical name is ExampleOfQuaternionDefinitionAndBasicAlgebra.
Accessed 36 times total.
Classification:
|
|
|
|
|
|
|
|
Pending Errata and Addenda
|
|
|
|
|
|
|
|
|
|
|