Physics Library
 An open source physics library
Encyclopedia | Forums | Docs | Random | Template Test |  
Login
create new user
Username:
Password:
forget your password?
Main Menu
Sections

Meta

Talkback

Downloads

Information
[parent] example of quaternion product (Example)

Quaternion Product in Scalar Vector Form: Examples, Exercises, and Solutions

This entry is the self study companion to quaternion product in scalar vector Form.

The emphasis is the Hamilton product itself: how its scalar and vector pieces arise, why the cross product sign determines the multiplication convention, and how noncommutativity is encoded geometrically.

All exercises are stated first. Complete worked solutions follow afterward.

Formula summary

Write

$\displaystyle p=p_w+\mathbf p, \qquad q=q_w+\mathbf q, $

where $p_w,q_w\in\mathbb{R}$ and $\mathbf p,\mathbf q$ are pure quaternions identified with three dimensional vectors.

PhysicsLibrary uses the Hamilton product

$\displaystyle pq = \left( p_wq_w-\mathbf p\cdot\mathbf q \right) + \left( p_w\mathbf q + q_w\mathbf p + \mathbf p\times\mathbf q \right).$ (1)

Equivalently,

$\displaystyle (p_w,\mathbf p)(q_w,\mathbf q) = \left( p_wq_w-\mathbf p\cdot\mathbf q,\; p_w\mathbf q+q_w\mathbf p+\mathbf p\times\mathbf q \right).$ (2)

For pure quaternions,

$\displaystyle \mathbf a\mathbf b = -\mathbf a\cdot\mathbf b + \mathbf a\times\mathbf b.$ (3)

Reversing the factors gives

$\displaystyle qp = \left( p_wq_w-\mathbf p\cdot\mathbf q \right) + \left( p_w\mathbf q + q_w\mathbf p - \mathbf p\times\mathbf q \right).$ (4)

Therefore the commutator is

$\displaystyle \relax[p,q] = pq-qp = 2\mathbf p\times\mathbf q.$ (5)

The symmetric combination is

$\displaystyle pq+qp = 2 \left( p_wq_w-\mathbf p\cdot\mathbf q \right) + 2 \left( p_w\mathbf q+q_w\mathbf p \right).$ (6)

Exercises

  1. Derive the pure quaternion product.

    Let

    $\displaystyle \mathbf a = a_x\mathbf i+a_y\mathbf j+a_z\mathbf k $

    and

    $\displaystyle \mathbf b = b_x\mathbf i+b_y\mathbf j+b_z\mathbf k. $

    Starting from Hamilton's basis products, derive

    $\displaystyle \mathbf a\mathbf b = -\mathbf a\cdot\mathbf b + \mathbf a\times\mathbf b. $

    Identify the scalar and vector parts explicitly.

  2. Product from scalar and vector parts.

    Let

    $\displaystyle p = 2+\mathbf i-2\mathbf j+\mathbf k $

    and

    $\displaystyle q = -1+3\mathbf i+2\mathbf k. $

    Compute $pq$ using the scalar vector formula rather than a sixteen term component expansion.

  3. Reverse the product efficiently.

    For the quaternions in Exercise 2, compute $qp$ without repeating the full calculation.

    Use the symmetry of the dot product and antisymmetry of the cross product.

  4. Commutator.

    Using the same $p$ and $q$, compute

    $\displaystyle [p,q] = pq-qp $

    both from the two products and directly from

    $\displaystyle [p,q] = 2\mathbf p\times\mathbf q. $

    Verify agreement.

  5. Anticommutator.

    Define

    $\displaystyle \{p,q\} = pq+qp.$ (7)

    Derive the scalar vector formula for $\{p,q\}$ and evaluate it for the quaternions in Exercise 2.

    Which geometric term disappears?

  6. Pure quaternion square.

    Use the scalar vector product to prove

    $\displaystyle \mathbf a^2 = -\lVert\mathbf a\rVert^2 $

    for every pure quaternion $\mathbf a$.

    What follows when $\lVert\mathbf a\rVert=1$?

  7. Perpendicular pure quaternions.

    Suppose

    $\displaystyle \mathbf a\cdot\mathbf b=0. $

    Show that

    $\displaystyle \mathbf a\mathbf b = \mathbf a\times\mathbf b $

    and

    $\displaystyle \mathbf b\mathbf a = -\mathbf a\times\mathbf b. $

    Use

    $\displaystyle \mathbf a = 2\mathbf i+\mathbf j, \qquad \mathbf b = \mathbf i-2\mathbf j $

    as a numerical example.

  8. Parallel pure quaternions.

    Let

    $\displaystyle \mathbf b=\lambda\mathbf a. $

    Show that $\mathbf a\mathbf b$ is purely real.

    Then evaluate

    $\displaystyle (2\mathbf i-\mathbf j+2\mathbf k) (6\mathbf i-3\mathbf j+6\mathbf k). $
  9. Geometric angle encoded in a pure product.

    Let $\mathbf a$ and $\mathbf b$ be unit pure quaternions separated by an angle $\gamma$.

    Show that

    $\displaystyle \mathbf a\mathbf b = -\cos\gamma + \widehat{\mathbf n}\sin\gamma,$ (8)

    where $\widehat{\mathbf n}$ points in the direction of $\mathbf a\times\mathbf b$.

    Evaluate the result for $\gamma=60^\circ$ and $\widehat{\mathbf n}=\mathbf k$.

  10. When do two quaternions commute?

    Starting from

    $\displaystyle [p,q] = 2\mathbf p\times\mathbf q, $

    prove that

    $\displaystyle pq=qp $

    if and only if the vector parts $\mathbf p$ and $\mathbf q$ are parallel, antiparallel, or one vector part is zero.

  11. A complex subalgebra.

    Let $\mathbf u$ be a fixed unit pure quaternion, and let

    $\displaystyle p=a+b\mathbf u, \qquad q=c+d\mathbf u. $

    Show directly that

    $\displaystyle pq = (ac-bd) + (ad+bc)\mathbf u. $

    Then show that $pq=qp$.

    Explain why this set is algebraically equivalent to the complex numbers.

  12. Component formula recovery.

    Starting from

    $\displaystyle pq = \left( p_wq_w-\mathbf p\cdot\mathbf q,\; p_w\mathbf q+q_w\mathbf p+\mathbf p\times\mathbf q \right), $

    derive the scalar first component formula

    $\displaystyle [pq]_{\mathrm{PL}} = \begin{bmatrix} p_wq_w-p_xq_x-p_yq_y-p_zq_z ... ... \ 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}.$ (9)
  13. Left multiplication matrix.

    For a fixed quaternion

    $\displaystyle p = p_w+p_x\mathbf i+p_y\mathbf j+p_z\mathbf k, $

    show that left multiplication can be written

    $\displaystyle [pq]_{\mathrm{PL}} = L(p) [q]_{\mathrm{PL}},$ (10)

    where

    $\displaystyle L(p) = \begin{bmatrix} p_w&-p_x&-p_y&-p_z\ p_x&p_w&-p_z&p_y\ p_y&p_z&p_w&-p_x\ p_z&-p_y&p_x&p_w \end{bmatrix}.$ (11)
  14. Right multiplication matrix.

    For fixed $q$, derive a matrix $R(q)$ satisfying

    $\displaystyle [pq]_{\mathrm{PL}} = R(q) [p]_{\mathrm{PL}}.$ (12)

    Compare the signs in $R(q)$ with those in $L(q)$.

  15. Associativity as a matrix identity.

    Use the left multiplication matrix to explain why associativity implies

    $\displaystyle L(pq) = L(p)L(q).$ (13)

    Verify this identity numerically for

    $\displaystyle p=1+\mathbf i, \qquad q=1+\mathbf j. $
  16. Hamilton versus flipped multiplication diagnostic.

    A source defines

    $\displaystyle (p_w,\mathbf p)\star(q_w,\mathbf q) = \left( p_wq_w-\mathbf p\cdot\mathbf q,\; p_w\mathbf q+q_w\mathbf p-\mathbf p\times\mathbf q \right).$ (14)

    Does $\star$ agree with PhysicsLibrary Hamilton multiplication?

    Show that

    $\displaystyle p\star q = qp $

    when the right hand side uses Hamilton multiplication.

  17. Passive attitude does not change Hamilton multiplication.

    PhysicsLibrary later represents a positive passive frame rotation about $+z$ by

    $\displaystyle q_P = \frac{1-\mathbf k}{\sqrt2}. $

    A student argues that because the attitude convention is passive, PhysicsLibrary should replace the $+\mathbf p\times\mathbf q$ term in the Hamilton product by a minus sign.

    Explain why this reasoning is incorrect.

    Use the basis check

    $\displaystyle \mathbf i\mathbf j $

    to show what would break if the multiplication law were changed.

Solutions

Solution 1: derive the pure quaternion product

Expand without changing factor order:

\begin{equation*} \begin{aligned} \mathbf a\mathbf b ={}& a_xb_x\mathbf i^2 + a_... ...f i + a_zb_y\mathbf k\mathbf j + a_zb_z\mathbf k^2. \end{aligned}\end{equation*}

Use

$\displaystyle \mathbf i^2=\mathbf j^2=\mathbf k^2=-1, $

$\displaystyle \mathbf i\mathbf j=\mathbf k, \qquad \mathbf j\mathbf k=\mathbf i, \qquad \mathbf k\mathbf i=\mathbf j, $

and the reversed negative products.

The scalar terms are

$\displaystyle -a_xb_x-a_yb_y-a_zb_z = -\mathbf a\cdot\mathbf b. $

The $\mathbf i$ coefficient is

$\displaystyle a_yb_z-a_zb_y. $

The $\mathbf j$ coefficient is

$\displaystyle a_zb_x-a_xb_z. $

The $\mathbf k$ coefficient is

$\displaystyle a_xb_y-a_yb_x. $

These are exactly the components of $\mathbf a\times\mathbf b$.

Therefore

$\displaystyle \mathbf a\mathbf b = -\mathbf a\cdot\mathbf b + \mathbf a\times\mathbf b.$ (15)

The scalar part is $-\mathbf a\cdot\mathbf b$ and the vector part is $\mathbf a\times\mathbf b$.

Solution 2: product from scalar and vector parts

Write

$\displaystyle p_w=2, \qquad \mathbf p = \begin{bmatrix} 1\\ -2\\ 1 \end{bmatrix}, $

and

$\displaystyle q_w=-1, \qquad \mathbf q = \begin{bmatrix} 3\\ 0\\ 2 \end{bmatrix}. $

The dot product is

$\displaystyle \mathbf p\cdot\mathbf q = 1(3)+(-2)(0)+1(2) = 5. $

The cross product is

$\displaystyle \mathbf p\times\mathbf q = \begin{bmatrix} -4\ 1\ 6 \end{bmatrix}. $

The scalar part is

$\displaystyle p_wq_w-\mathbf p\cdot\mathbf q = 2(-1)-5 = -7. $

The vector part is

\begin{equation*} \begin{aligned} p_w\mathbf q + q_w\mathbf p + \mathbf p\times\... ...rix}\ &= \begin{bmatrix} 1\\ 3\\ 9 \end{bmatrix}. \end{aligned}\end{equation*}

Hence

$\displaystyle pq = -7+\mathbf i+3\mathbf j+9\mathbf k.$ (16)

Solution 3: reverse the product efficiently

The scalar part remains unchanged because

$\displaystyle \mathbf q\cdot\mathbf p = \mathbf p\cdot\mathbf q. $

The scalar multiplication terms in the vector part are also unchanged:

$\displaystyle q_w\mathbf p+p_w\mathbf q = p_w\mathbf q+q_w\mathbf p. $

Only the cross product changes sign:

$\displaystyle \mathbf q\times\mathbf p = -\mathbf p\times\mathbf q = \begin{bmatrix} 4\\ -1\\ -6 \end{bmatrix}. $

Thus the vector part of $qp$ is

\begin{equation*} \begin{aligned} q_w\mathbf p + p_w\mathbf q + \mathbf q\times\... ...ix}\ &= \begin{bmatrix} 9\\ 1\\ -3 \end{bmatrix}. \end{aligned}\end{equation*}

Therefore

$\displaystyle qp = -7+9\mathbf i+\mathbf j-3\mathbf k.$ (17)

Solution 4: commutator

From Solutions 2 and 3,

\begin{equation*} \begin{aligned}[p,q] &= pq-qp\ &= (-7+\mathbf i+3\mathbf j+9\mathbf k) - (-7+9\mathbf i+\mathbf j-3\mathbf k). \end{aligned}\end{equation*}

Thus

$\displaystyle \relax[p,q] = -8\mathbf i+2\mathbf j+12\mathbf k.$ (18)

Directly,

$\displaystyle 2\mathbf p\times\mathbf q = 2 \begin{bmatrix} -4\\ 1\\ 6 \end{bmatrix}= \begin{bmatrix} -8\\ 2\\ 12 \end{bmatrix}, $

which gives the same pure quaternion.

Solution 5: anticommutator

Add the general products:

$\displaystyle pq = \left( p_wq_w-\mathbf p\cdot\mathbf q,\; p_w\mathbf q+q_w\mathbf p+\mathbf p\times\mathbf q \right) $

and

$\displaystyle qp = \left( p_wq_w-\mathbf p\cdot\mathbf q,\; p_w\mathbf q+q_w\mathbf p-\mathbf p\times\mathbf q \right). $

The cross products cancel.

Therefore

$\displaystyle \{p,q\} = 2 \left( p_wq_w-\mathbf p\cdot\mathbf q \right) + 2 \left( p_w\mathbf q+q_w\mathbf p \right).$ (19)

For Exercise 2,

$\displaystyle pq = -7+\mathbf i+3\mathbf j+9\mathbf k $

and

$\displaystyle qp = -7+9\mathbf i+\mathbf j-3\mathbf k. $

Thus

$\displaystyle \{p,q\} = -14+10\mathbf i+4\mathbf j+6\mathbf k.$ (20)

The oriented cross product term disappears from the symmetric combination.

Solution 6: pure quaternion square

Set $\mathbf b=\mathbf a$ in

$\displaystyle \mathbf a\mathbf b = -\mathbf a\cdot\mathbf b + \mathbf a\times\mathbf b. $

Then

$\displaystyle \mathbf a^2 = -\mathbf a\cdot\mathbf a + \mathbf a\times\mathbf a. $

Since

$\displaystyle \mathbf a\cdot\mathbf a = \lVert\mathbf a\rVert^2 $

and

$\displaystyle \mathbf a\times\mathbf a=\mathbf 0, $

we obtain

$\displaystyle \mathbf a^2 = -\lVert\mathbf a\rVert^2.$ (21)

If $\lVert\mathbf a\rVert=1$, then

$\displaystyle \mathbf a^2=-1.$ (22)

Solution 7: perpendicular pure quaternions

If

$\displaystyle \mathbf a\cdot\mathbf b=0, $

then

$\displaystyle \mathbf a\mathbf b = \mathbf a\times\mathbf b. $

Reversing the order gives

$\displaystyle \mathbf b\mathbf a = \mathbf b\times\mathbf a = -\mathbf a\times\mathbf b. $

For

$\displaystyle \mathbf a= \begin{bmatrix} 2\\ 1\\ 0 \end{bmatrix}, \qquad \mathbf b= \begin{bmatrix} 1\\ -2\\ 0 \end{bmatrix}, $

the dot product is

$\displaystyle 2(1)+1(-2)=0. $

The cross product is

$\displaystyle \mathbf a\times\mathbf b = \begin{bmatrix} 0\\ 0\\ -5 \end{bmatrix}. $

Therefore

$\displaystyle \mathbf a\mathbf b = -5\mathbf k, \qquad \mathbf b\mathbf a = 5\mathbf k.$ (23)

Solution 8: parallel pure quaternions

If

$\displaystyle \mathbf b=\lambda\mathbf a, $

then

$\displaystyle \mathbf a\times\mathbf b = \lambda \mathbf a\times\mathbf a = 0. $

Thus

$\displaystyle \mathbf a\mathbf b = -\mathbf a\cdot\mathbf b, $

which is purely real.

For

$\displaystyle \mathbf a = 2\mathbf i-\mathbf j+2\mathbf k $

and

$\displaystyle \mathbf b = 6\mathbf i-3\mathbf j+6\mathbf k = 3\mathbf a, $

we have

$\displaystyle \mathbf a\cdot\mathbf b = 2(6)+(-1)(-3)+2(6) = 27. $

Therefore

$\displaystyle \mathbf a\mathbf b=-27.$ (24)

Solution 9: geometric angle encoded in a pure product

For unit vectors,

$\displaystyle \mathbf a\cdot\mathbf b = \cos\gamma. $

Also,

$\displaystyle \lVert \mathbf a\times\mathbf b \rVert = \sin\gamma. $

If $\widehat{\mathbf n}$ is the unit vector in the direction of the cross product,

$\displaystyle \mathbf a\times\mathbf b = \widehat{\mathbf n}\sin\gamma. $

Therefore

$\displaystyle \mathbf a\mathbf b = -\cos\gamma + \widehat{\mathbf n}\sin\gamma.$ (25)

For

$\displaystyle \gamma=60^\circ, \qquad \widehat{\mathbf n}=\mathbf k, $

we get

$\displaystyle \mathbf a\mathbf b = -\frac12 + \frac{\sqrt3}{2}\mathbf k.$ (26)

Solution 10: when do two quaternions commute?

The commutator is

$\displaystyle [p,q] = 2\mathbf p\times\mathbf q. $

Therefore

$\displaystyle pq=qp $

if and only if

$\displaystyle \mathbf p\times\mathbf q=0. $

In three dimensional Euclidean space, a cross product is zero exactly when the vectors are linearly dependent or one is zero.

Thus the vector parts must be parallel, antiparallel, or one vector part must vanish.

Hence

$\displaystyle pq=qp \quad\Longleftrightarrow\quad \mathbf p\times\mathbf q=0.$ (27)

Solution 11: a complex subalgebra

Let

$\displaystyle p=a+b\mathbf u, \qquad q=c+d\mathbf u, $

with

$\displaystyle \mathbf u^2=-1. $

Multiply:

\begin{equation*} \begin{aligned} pq &= ac + ad\mathbf u + bc\mathbf u + bd\mathbf u^2\ &= (ac-bd) + (ad+bc)\mathbf u. \end{aligned}\end{equation*}

Therefore

$\displaystyle pq = (ac-bd) + (ad+bc)\mathbf u.$ (28)

Reversing the factors gives

$\displaystyle qp = (ca-db) + (cb+da)\mathbf u. $

Real coefficients commute, so

$\displaystyle qp=pq. $

The map

$\displaystyle a+b\mathbf u \longleftrightarrow a+b\,\mathrm i_{\mathbb{C}} $

preserves addition and multiplication because both imaginary units square to $-1$.

Thus this two dimensional quaternion subalgebra is isomorphic to the complex numbers.

Solution 12: component formula recovery

The scalar part is

$\displaystyle p_wq_w - (p_xq_x+p_yq_y+p_zq_z), $

so the first component is

$\displaystyle p_wq_w-p_xq_x-p_yq_y-p_zq_z. $

For the vector part,

$\displaystyle p_w\mathbf q + q_w\mathbf p + \mathbf p\times\mathbf q, $

the cross product is

$\displaystyle \mathbf p\times\mathbf q = \begin{bmatrix} p_yq_z-p_zq_y\ p_zq_x-p_xq_z\ p_xq_y-p_yq_x \end{bmatrix}. $

Add the scalar multiple terms componentwise.

The $\mathbf i$ component becomes

$\displaystyle p_wq_x+p_xq_w+p_yq_z-p_zq_y. $

The $\mathbf j$ component becomes

$\displaystyle p_wq_y-p_xq_z+p_yq_w+p_zq_x. $

The $\mathbf k$ component becomes

$\displaystyle p_wq_z+p_xq_y-p_yq_x+p_zq_w. $

Therefore

$\displaystyle [pq]_{\mathrm{PL}} = \begin{bmatrix} p_wq_w-p_xq_x-p_yq_y-p_zq_z ... ... \ 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}.$ (29)

Solution 13: left multiplication matrix

Start from the component formula for $pq$ and collect coefficients multiplying

$\displaystyle q_w, \quad q_x, \quad q_y, \quad q_z. $

The scalar component is

$\displaystyle p_wq_w-p_xq_x-p_yq_y-p_zq_z. $

The $\mathbf i$ component is

$\displaystyle p_xq_w+p_wq_x-p_zq_y+p_yq_z. $

The $\mathbf j$ component is

$\displaystyle p_yq_w+p_zq_x+p_wq_y-p_xq_z. $

The $\mathbf k$ component is

$\displaystyle p_zq_w-p_yq_x+p_xq_y+p_wq_z. $

Hence

$\displaystyle [pq]_{\mathrm{PL}} = \begin{bmatrix} p_w&-p_x&-p_y&-p_z\ p_x&p_w&-p_z&p_y\ p_y&p_z&p_w&-p_x\ p_z&-p_y&p_x&p_w \end{bmatrix}[q]_{\mathrm{PL}}.$ (30)

Thus

$\displaystyle L(p) = \begin{bmatrix} p_w&-p_x&-p_y&-p_z\ p_x&p_w&-p_z&p_y\ p_y&p_z&p_w&-p_x\ p_z&-p_y&p_x&p_w \end{bmatrix}.$ (31)

Solution 14: right multiplication matrix

Now collect the component formula for $pq$ by coefficients of the components of $p$.

The result is

$\displaystyle R(q) = \begin{bmatrix} q_w&-q_x&-q_y&-q_z\ q_x&q_w&q_z&-q_y\ q_y&-q_z&q_w&q_x\ q_z&q_y&-q_x&q_w \end{bmatrix},$ (32)

so that

$\displaystyle [pq]_{\mathrm{PL}} = R(q) [p]_{\mathrm{PL}}.$ (33)

Compare $R(q)$ with

$\displaystyle L(q) = \begin{bmatrix} q_w&-q_x&-q_y&-q_z\ q_x&q_w&-q_z&q_y\ q_y&q_z&q_w&-q_x\ q_z&-q_y&q_x&q_w \end{bmatrix}. $

The scalar row is identical, but the signs associated with the cross product structure differ. This is the matrix manifestation of left versus right Hamilton multiplication.

Solution 15: associativity as a matrix identity

For any quaternion $r$,

$\displaystyle L(pq)[r]_{\mathrm{PL}} = [(pq)r]_{\mathrm{PL}}. $

Associativity gives

$\displaystyle (pq)r = p(qr). $

Therefore

$\displaystyle [(pq)r]_{\mathrm{PL}} = L(p)L(q)[r]_{\mathrm{PL}}. $

Since this holds for every $r$,

$\displaystyle L(pq) = L(p)L(q).$ (34)

For

$\displaystyle p=1+\mathbf i, \qquad q=1+\mathbf j, $

the Hamilton product is

$\displaystyle pq = 1+\mathbf i+\mathbf j+\mathbf k. $

Thus

$\displaystyle L(pq) = \begin{bmatrix} 1&-1&-1&-1\ 1&1&-1&1\ 1&1&1&-1\ 1&-1&1&1 \end{bmatrix}. $

Also,

$\displaystyle L(p) = \begin{bmatrix} 1&-1&0&0\ 1&1&0&0\ 0&0&1&-1\ 0&0&1&1 \end{bmatrix}, $

and

$\displaystyle L(q) = \begin{bmatrix} 1&0&-1&0\ 0&1&0&1\ 1&0&1&0\ 0&-1&0&1 \end{bmatrix}. $

Direct matrix multiplication gives

$\displaystyle L(p)L(q) = \begin{bmatrix} 1&-1&-1&-1\ 1&1&-1&1\ 1&1&1&-1\ 1&-1&1&1 \end{bmatrix}= L(pq).$ (35)

Solution 16: Hamilton versus flipped multiplication diagnostic

PhysicsLibrary Hamilton multiplication uses

$\displaystyle +\mathbf p\times\mathbf q $

in the vector part.

The proposed operation $\star$ uses

$\displaystyle -\mathbf p\times\mathbf q. $

Therefore it does not agree with PhysicsLibrary Hamilton multiplication.

Under Hamilton multiplication,

$\displaystyle qp = \left( q_wp_w-\mathbf q\cdot\mathbf p,\; q_w\mathbf p+p_w\mathbf q+\mathbf q\times\mathbf p \right). $

Use

$\displaystyle \mathbf q\cdot\mathbf p = \mathbf p\cdot\mathbf q $

and

$\displaystyle \mathbf q\times\mathbf p = -\mathbf p\times\mathbf q. $

Then

$\displaystyle qp = \left( p_wq_w-\mathbf p\cdot\mathbf q,\; p_w\mathbf q+q_w\mathbf p-\mathbf p\times\mathbf q \right). $

Hence

$\displaystyle p\star q = qp.$ (36)

The proposed operation is the reversed Hamilton product.

Solution 17: passive attitude does not change Hamilton multiplication

The passive attitude convention specifies how a quaternion is interpreted as a frame transformation.

Hamilton multiplication specifies the algebra used to multiply quaternion elements.

These are separate choices.

PhysicsLibrary retains

$\displaystyle \mathbf i\mathbf j=\mathbf k $

whether the quaternion is being used as a passive attitude map, an algebraic quantity, or a pure quaternion encoding a vector.

If the cross product sign were changed merely because an attitude convention was passive, then the pure product rule would become

$\displaystyle \mathbf i\mathbf j = -\mathbf i\times\mathbf j = -\mathbf k. $

That would contradict the declared Hamilton basis relation

$\displaystyle \mathbf i\mathbf j=\mathbf k. $

Thus the later passive attitude quaternion

$\displaystyle q_P = \frac{1-\mathbf k}{\sqrt2} $

changes the interpretation of the quaternion's vector sign for a positive frame rotation. It does not change the multiplication law.

Compact review

The multiplication companion can be summarized by four identities:

$\displaystyle pq = \left( p_wq_w-\mathbf p\cdot\mathbf q,\; p_w\mathbf q+q_w\mathbf p+\mathbf p\times\mathbf q \right),$ (37)
$\displaystyle \mathbf a\mathbf b = -\mathbf a\cdot\mathbf b + \mathbf a\times\mathbf b,$ (38)
$\displaystyle \relax[p,q] = 2\mathbf p\times\mathbf q,$ (39)

and

$\displaystyle pq=qp \quad\Longleftrightarrow\quad \mathbf p\times\mathbf q=0.$ (40)

The cross product sign is a direct multiplication convention diagnostic: PhysicsLibrary Hamilton multiplication uses the positive sign.

Sources and exercise provenance

The exercises and solutions in this companion are newly written or expanded for PhysicsLibrary from the algebra developed in Quaternion Product in Scalar Vector Form.

Hamilton is the foundational source for the quaternion product. Joly and Kelland–Tait provide classical systematic treatments and examples. Sommer and coauthors provide a modern discussion of Hamilton versus reversed quaternion multiplication in engineering applications.

Bibliography

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 search
3
P. Kelland and P. G. Tait, Introduction to Quaternions, with Numerous Examples, 2nd ed., Macmillan and Co., London, 1882. Public domain historical source. Internet Archive search
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.



"example of quaternion product" is owned by bloftin.
(view preamble)
View style:
See Also: quaternion series overview and article guide, Notation Quaternions for Physics and Engineering: Orientation, quaternion definition and basic algebra, example of quaternion definition and basic algebra, 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:  quaternion, Hamilton product, scalar vector form, dot product, cross product, pure quaternion, commutator, noncommutative algebra, quaternion multiplication, vector analysis, exercises, worked solutions

This object's parent.

Cross-references: relation, algebraic, operation, matrix multiplication, unit vectors, identity, matrix, commute, square, dot product, formula, commutator, quaternions, cross product, vector, scalar, quaternion product
There is 1 reference to this object.

This is version 2 of example of quaternion product, born on 2026-08-28, modified 2026-08-28.
Object id is 1115, canonical name is ExampleOfQuaternionProduct.
Accessed 20 times total.

Classification:
Physics Classification02.10.Hh (Rings and algebras)
 02.10.Ud (Linear algebra)
 02.10.Xm (Multilinear algebra)
Pending Errata and Addenda
None.
Discussion
Style: Expand: Order:

No messages.

Interact
rate | post | correct | update request | add example | add (any)