<?xml version="1.0" encoding="UTF-8"?>

<record version="1" id="1090">
 <title>quaternion Product</title>
 <name>QuaternionProduct</name>
 <created>2026-08-23 18:02:26</created>
 <modified>2026-08-23 18:02:26</modified>
 <type>Definition</type>
 <creator id="1" name="bloftin"/>
 <modifier id="1" name="bloftin"/>
 <author id="1" name="bloftin"/>
 <classification>
	<category scheme="pacs" code="02.10.Hh"/>
	<category scheme="pacs" code="02.10.Ud"/>
	<category scheme="pacs" code="02.10.Xm"/>
 </classification>
 <related>
	<object name="QuaternionDefinitionAndBasicAlgebra"/>
 </related>
 <keywords>
	<term>quaternion</term>
	<term>Hamilton product</term>
	<term>scalar vector form</term>
	<term>dot product</term>
	<term>cross product</term>
	<term>pure quaternion</term>
	<term>commutator</term>
	<term>noncommutative algebra</term>
	<term>quaternion multiplication</term>
	<term>vector analysis</term>
 </keywords>
 <preamble>% this is the default PhysicsLibrary preamble.  as your knowledge
% of TeX increases, you will probably want to edit this, but
% it should be fine as is for beginners.

% almost certainly you want these
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}

% used for TeXing text within eps files
%\usepackage{psfrag}
% need this for including graphics (\includegraphics)
%\usepackage{graphicx}
% for neatly defining theorems and propositions
%\usepackage{amsthm}
% making logically defined graphics
%\usepackage{xypic}

% there are many more packages, add them here as you need them

% define commands here</preamble>
 <content>% PhysicsLibrary quaternion convention used in this article:
%   * right-handed orthonormal physical frames unless otherwise stated;
%   * positive physical rotation follows the right-hand screw rule;
%   * Hamilton multiplication: i j = k, j k = i, k i = j;
%   * scalar-first display order: [q_w,q_x,q_y,q_z]^T;
%   * the ordinary 3-D cross product is the right-handed cross product;
%   * scalar-first/scalar-last storage is NOT a multiplication convention.

\section*{Quaternion Product in Scalar Vector Form}

The component formula for quaternion multiplication is correct but easy to
misremember because of its pattern of signs.  For physics and engineering, a
more revealing form separates each quaternion into a real scalar and an ordinary
three-dimensional vector.  Hamilton multiplication then becomes a single
formula involving only the familiar dot and cross products.

Let
\[
p=p_w+\mathbf p,
\qquad
q=q_w+\mathbf q,
\]
where $p_w,q_w\in\mathbb R$ and $\mathbf p,\mathbf q\in\mathbb R^3$ are
identified with pure quaternions.  The Hamilton product is
\[
\boxed{
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).
}
\tag{1}
\]
Equivalently, as an ordered scalar--vector pair,
\[
\boxed{
(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).
}
\tag{2}
\]

Equation (2) is one of the most useful forms of the Hamilton product for
mechanics, attitude dynamics, navigation, robotics, and software.  It shows
immediately which part of multiplication is symmetric, which part changes sign
when the order is reversed, and why quaternion multiplication is naturally tied
to three-dimensional geometry.

\section{Convention declaration}

This entry uses the PhysicsLibrary convention established in the preceding
quaternion entries:
\[
\mathbf i\mathbf j=\mathbf k,
\qquad
\mathbf j\mathbf k=\mathbf i,
\qquad
\mathbf k\mathbf i=\mathbf j,
\tag{3}
\]
with reversed products changing sign.  The three-dimensional cross product is
the ordinary right-handed cross product,
\[
\hat{\mathbf x}\times\hat{\mathbf y}=\hat{\mathbf z}.
\tag{4}
\]
Therefore the vector cross-product term in equation (1) appears with a
\emph{plus} sign.

Some aerospace and software literature uses the opposite, or flipped,
quaternion multiplication.  With the same right-handed vector cross product,
that multiplication produces a minus sign in front of $\mathbf p\times\mathbf q$.
This difference is sometimes described as right-handed versus left-handed
quaternions.  Those names are not reliable by themselves because authors have
used ``handedness'' for the physical frame, screw sense, cross product, and
quaternion algebra.  The equation
\[
\mathbf i\mathbf j=+\mathbf k
\quad\hbox{or}\quad
\mathbf i\star\mathbf j=-\mathbf k
\tag{5}
\]
is the safer diagnostic.

\section{Pure-vector multiplication is the key}

The entire scalar--vector formula follows from first understanding the product
of two pure quaternions.  Let
\[
\mathbf a=a_x\mathbf i+a_y\mathbf j+a_z\mathbf k,
\qquad
\mathbf b=b_x\mathbf i+b_y\mathbf j+b_z\mathbf k.
\tag{6}
\]
Expanding their quaternion product gives
\[
\begin{aligned}
\mathbf a\mathbf b={}&amp;
 a_xb_x\mathbf i^2+a_yb_y\mathbf j^2+a_zb_z\mathbf k^2\\
&amp;+a_xb_y\mathbf i\mathbf j+a_xb_z\mathbf i\mathbf k
 +a_yb_x\mathbf j\mathbf i+a_yb_z\mathbf j\mathbf k\\
&amp;+a_zb_x\mathbf k\mathbf i+a_zb_y\mathbf k\mathbf j.
\end{aligned}
\tag{7}
\]
Using
\[
\mathbf i^2=\mathbf j^2=\mathbf k^2=-1
\tag{8}
\]
and the cyclic products in equation (3), the scalar terms are
\[
-(a_xb_x+a_yb_y+a_zb_z)
=-\mathbf a\cdot\mathbf b,
\tag{9}
\]
while the vector terms are
\[
\begin{aligned}
&amp;(a_yb_z-a_zb_y)\mathbf i\\
&amp;\quad +(a_zb_x-a_xb_z)\mathbf j\\
&amp;\quad +(a_xb_y-a_yb_x)\mathbf k
=\mathbf a\times\mathbf b.
\end{aligned}
\tag{10}
\]
Hence
\[
\boxed{
\mathbf a\mathbf b
=-\mathbf a\cdot\mathbf b+\mathbf a\times\mathbf b.
}
\tag{11}
\]

This compact identity is the bridge between Hamilton's nineteenth-century
quaternion multiplication and modern vector analysis.  The scalar part contains
minus the dot product; the vector part contains the cross product.

Historical quaternion texts commonly denoted these two pieces by $S(\mathbf
 a\mathbf b)$ and $V(\mathbf a\mathbf b)$.  In modern notation,
\[
\operatorname{Sc}(\mathbf a\mathbf b)
=-\mathbf a\cdot\mathbf b,
\qquad
\operatorname{Vec}(\mathbf a\mathbf b)
=\mathbf a\times\mathbf b.
\tag{12}
\]

\section{Deriving the general scalar--vector product}

Write
\[
p=p_w+\mathbf p,
\qquad
q=q_w+\mathbf q.
\tag{13}
\]
By distributivity,
\[
\begin{aligned}
pq
&amp;=(p_w+\mathbf p)(q_w+\mathbf q)\\
&amp;=p_wq_w+p_w\mathbf q+q_w\mathbf p+\mathbf p\mathbf q.
\end{aligned}
\tag{14}
\]
Real scalars commute with quaternions, so no ordering ambiguity occurs in the
middle two terms.  Apply equation (11) to the pure-vector product:
\[
\mathbf p\mathbf q
=-\mathbf p\cdot\mathbf q+\mathbf p\times\mathbf q.
\tag{15}
\]
Substitution gives
\[
\begin{aligned}
pq={}&amp;p_wq_w-\mathbf p\cdot\mathbf q\\
&amp;+p_w\mathbf q+q_w\mathbf p+\mathbf p\times\mathbf q.
\end{aligned}
\tag{16}
\]
Separating scalar and vector parts yields
\[
\boxed{
\operatorname{Sc}(pq)=p_wq_w-\mathbf p\cdot\mathbf q,
}
\tag{17}
\]
and
\[
\boxed{
\operatorname{Vec}(pq)
=p_w\mathbf q+q_w\mathbf p+\mathbf p\times\mathbf q.
}
\tag{18}
\]
Equations (17)--(18) are exactly equivalent to the four-component Hamilton
product derived in the preceding PhysicsLibrary entry.

\section{Recovering the component formula}

Let
\[
\mathbf p=
\begin{bmatrix}p_x\\p_y\\p_z\end{bmatrix},
\qquad
\mathbf q=
\begin{bmatrix}q_x\\q_y\\q_z\end{bmatrix}.
\tag{19}
\]
Then
\[
\mathbf p\cdot\mathbf q=p_xq_x+p_yq_y+p_zq_z,
\tag{20}
\]
and
\[
\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}.
\tag{21}
\]
Therefore equation (2) becomes
\[
\boxed{
[pq]_{\mathrm{PL}}
=
\begin{bmatrix}
 p_wq_w-p_xq_x-p_yq_y-p_zq_z\\
 p_wq_x+p_xq_w+p_yq_z-p_zq_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}.
}
\tag{22}
\]
The apparently irregular signs in the component formula are therefore not
arbitrary: the scalar signs come from the negative dot product and the
antisymmetric signs come from the cross product.

\section{Why reversing the product changes only the cross term}

Reverse the factors in equation (2):
\[
qp
=
\left(
q_wp_w-\mathbf q\cdot\mathbf p,
\;q_w\mathbf p+p_w\mathbf q+\mathbf q\times\mathbf p
\right).
\tag{23}
\]
The dot product is symmetric,
\[
\mathbf q\cdot\mathbf p=\mathbf p\cdot\mathbf q,
\tag{24}
\]
whereas the cross product is antisymmetric,
\[
\mathbf q\times\mathbf p=-\mathbf p\times\mathbf q.
\tag{25}
\]
Thus
\[
\operatorname{Sc}(pq)=\operatorname{Sc}(qp),
\tag{26}
\]
but generally
\[
\operatorname{Vec}(pq)\ne\operatorname{Vec}(qp).
\tag{27}
\]
Subtracting the two products gives the quaternion commutator
\[
\boxed{
pq-qp=2\,\mathbf p\times\mathbf q,
}
\tag{28}
\]
where the right-hand side is interpreted as a pure quaternion.

An immediate consequence is that two quaternions commute precisely when their
vector parts are parallel or one of the vector parts vanishes:
\[
pq=qp
\quad\Longleftrightarrow\quad
\mathbf p\times\mathbf q=\mathbf 0.
\tag{29}
\]
This statement includes ordinary real numbers as the special case of zero vector
part.

\section{Dot and cross products can be recovered from quaternion products}

For pure quaternions $\mathbf a$ and $\mathbf b$, equation (11) and the reversed
product give
\[
\mathbf a\mathbf b
=-\mathbf a\cdot\mathbf b+\mathbf a\times\mathbf b,
\tag{30}
\]
\[
\mathbf b\mathbf a
=-\mathbf a\cdot\mathbf b-\mathbf a\times\mathbf b.
\tag{31}
\]
Adding them isolates the dot product:
\[
\boxed{
\mathbf a\cdot\mathbf b
=-\frac12\left(\mathbf a\mathbf b+\mathbf b\mathbf a\right).
}
\tag{32}
\]
Subtracting them isolates the cross product:
\[
\boxed{
\mathbf a\times\mathbf b
=\frac12\left(\mathbf a\mathbf b-\mathbf b\mathbf a\right).
}
\tag{33}
\]
Thus the familiar dot and cross products are respectively the symmetric-scalar
and antisymmetric-vector pieces of the Hamilton product of pure quaternions.

\section{Geometric special cases}

Let $\theta$ be the angle from $\mathbf a$ to $\mathbf b$.  Since
\[
\mathbf a\cdot\mathbf b
=\lVert\mathbf a\rVert\lVert\mathbf b\rVert\cos\theta
\tag{34}
\]
and
\[
\mathbf a\times\mathbf b
=\lVert\mathbf a\rVert\lVert\mathbf b\rVert
 \sin\theta\,\hat{\mathbf n},
\tag{35}
\]
where $\hat{\mathbf n}$ is the right-hand-rule unit normal, equation (11) gives
\[
\boxed{
\mathbf a\mathbf b
=\lVert\mathbf a\rVert\lVert\mathbf b\rVert
\left(-\cos\theta+\hat{\mathbf n}\sin\theta\right).
}
\tag{36}
\]
This formula already hints at the trigonometric structure that will later appear
in unit-quaternion rotations.

\subsection{Parallel vectors}

If $\mathbf a\parallel\mathbf b$, then
\[
\mathbf a\times\mathbf b=\mathbf0,
\]
so the product is purely scalar:
\[
\mathbf a\mathbf b=-\mathbf a\cdot\mathbf b.
\tag{37}
\]
For a pure quaternion multiplied by itself,
\[
\boxed{
\mathbf a^2=-\lVert\mathbf a\rVert^2.
}
\tag{38}
\]
In particular, every unit pure quaternion satisfies $\mathbf u^2=-1$.

\subsection{Perpendicular vectors}

If $\mathbf a\perp\mathbf b$, then
\[
\mathbf a\cdot\mathbf b=0,
\]
so
\[
\boxed{
\mathbf a\mathbf b=\mathbf a\times\mathbf b.
}
\tag{39}
\]
Reversing the factors gives
\[
\mathbf b\mathbf a=-\mathbf a\times\mathbf b=-\mathbf a\mathbf b.
\tag{40}
\]
The basis relation $\mathbf i\mathbf j=\mathbf k$ is simply the special case of
equation (39) for mutually perpendicular unit vectors in a right-handed basis.

\section{Worked example 1: a general quaternion product}

Let
\[
p=(2,\,[1,-2,3]^T),
\qquad
q=(-1,\,[4,0,2]^T).
\tag{41}
\]
First compute the dot product:
\[
\mathbf p\cdot\mathbf q
=1(4)+(-2)(0)+3(2)=10.
\tag{42}
\]
The scalar part is therefore
\[
p_wq_w-\mathbf p\cdot\mathbf q
=2(-1)-10=-12.
\tag{43}
\]
Next compute
\[
\mathbf p\times\mathbf q
=
\begin{bmatrix}1\\-2\\3\end{bmatrix}
\times
\begin{bmatrix}4\\0\\2\end{bmatrix}
=
\begin{bmatrix}-4\\10\\8\end{bmatrix}.
\tag{44}
\]
The vector part is
\[
\begin{aligned}
p_w\mathbf q+q_w\mathbf p+\mathbf p\times\mathbf q
&amp;=2\begin{bmatrix}4\\0\\2\end{bmatrix}
 -\begin{bmatrix}1\\-2\\3\end{bmatrix}
 +\begin{bmatrix}-4\\10\\8\end{bmatrix}\\
&amp;=\begin{bmatrix}3\\12\\9\end{bmatrix}.
\end{aligned}
\tag{45}
\]
Hence
\[
\boxed{
pq=(-12,\,[3,12,9]^T).
}
\tag{46}
\]

Reversing the order leaves the scalar part unchanged but changes the cross term:
\[
\boxed{
qp=(-12,\,[11,-8,-7]^T).
}
\tag{47}
\]
Indeed,
\[
pq-qp
=(0,\,[-8,20,16]^T)
=2(0,\,\mathbf p\times\mathbf q).
\tag{48}
\]

\section{Worked example 2: the basis rules from vector analysis}

Take
\[
\mathbf a=\mathbf i,
\qquad
\mathbf b=\mathbf j.
\]
Because the vectors are perpendicular,
\[
\mathbf i\cdot\mathbf j=0.
\]
Because the basis is right handed,
\[
\mathbf i\times\mathbf j=\mathbf k.
\]
Therefore equation (11) gives
\[
\boxed{\mathbf i\mathbf j=\mathbf k.}
\tag{49}
\]
Reversing the order,
\[
\mathbf j\times\mathbf i=-\mathbf k,
\]
so
\[
\boxed{\mathbf j\mathbf i=-\mathbf k.}
\tag{50}
\]
The noncommutative multiplication table is therefore encoded directly in the
orientation of the ordinary cross product.

\section{Worked example 3: a mechanics interpretation}

Let a position vector and force be
\[
\mathbf r=
\begin{bmatrix}2\\0\\0\end{bmatrix}\ \mathrm m,
\qquad
\mathbf F=
\begin{bmatrix}3\\4\\0\end{bmatrix}\ \mathrm N.
\tag{51}
\]
Embed both as pure quaternions.  Their Hamilton product is
\[
\mathbf r\mathbf F
=-\mathbf r\cdot\mathbf F+\mathbf r\times\mathbf F.
\tag{52}
\]
The dot product is
\[
\mathbf r\cdot\mathbf F=6\ \mathrm{N\,m},
\tag{53}
\]
and the cross product is
\[
\mathbf r\times\mathbf F
=
\begin{bmatrix}0\\0\\8\end{bmatrix}\ \mathrm{N\,m}.
\tag{54}
\]
Thus
\[
\boxed{
\mathbf r\mathbf F=-6+8\mathbf k
\quad (\mathrm{N\,m}).
}
\tag{55}
\]
The vector part is exactly the torque about the origin,
\[
\boldsymbol\tau=\mathbf r\times\mathbf F=8\mathbf k\ \mathrm{N\,m}.
\tag{56}
\]
The scalar part is minus the ordinary dot product.  The quaternion product does
not imply that these two pieces are the same physical observable; rather, it
packages the longitudinal and rotational geometric products of the same pair of
vectors into one algebraic object.  This is one reason quaternion methods were
historically attractive in mathematical physics.

\section{Matrix form for implementation}

For software it is often convenient to represent left multiplication by a fixed
quaternion as a $4\times4$ real matrix.  With scalar-first ordering,
\[
[pq]_{\mathrm{PL}}=L(p)[q]_{\mathrm{PL}},
\tag{57}
\]
where
\[
\boxed{
L(p)=
\begin{bmatrix}
 p_w&amp;-p_x&amp;-p_y&amp;-p_z\\
 p_x&amp;p_w&amp;-p_z&amp;p_y\\
 p_y&amp;p_z&amp;p_w&amp;-p_x\\
 p_z&amp;-p_y&amp;p_x&amp;p_w
\end{bmatrix}.
}
\tag{58}
\]
Similarly,
\[
[pq]_{\mathrm{PL}}=R(q)[p]_{\mathrm{PL}},
\tag{59}
\]
with
\[
\boxed{
R(q)=
\begin{bmatrix}
 q_w&amp;-q_x&amp;-q_y&amp;-q_z\\
 q_x&amp;q_w&amp;q_z&amp;-q_y\\
 q_y&amp;-q_z&amp;q_w&amp;q_x\\
 q_z&amp;q_y&amp;-q_x&amp;q_w
\end{bmatrix}.
}
\tag{60}
\]
The two matrices are generally different because left and right quaternion
multiplication are different operations.  Their distinction becomes important
later in quaternion kinematics, where angular velocity may multiply the attitude
quaternion on different sides depending on the frame and mapping convention.

\section{Common pitfalls}

\begin{enumerate}
\item \textbf{Using $+\mathbf p\cdot\mathbf q$ in the scalar part.}
      Under Hamilton's convention, pure-vector squares are negative, so the
      scalar term is $-\mathbf p\cdot\mathbf q$.

\item \textbf{Changing the cross-product sign because the components are stored
      scalar last.}  Storage order does not alter the algebra.  Scalar-first and
      scalar-last Hamilton quaternions both use the $+\mathbf p\times\mathbf q$
      term when the same right-handed cross product is used.

\item \textbf{Calling $\mathbf i\mathbf j=-\mathbf k$ merely a different array
      convention.}  It is a different multiplication convention relative to
      Hamilton multiplication.

\item \textbf{Treating the vector part of a quaternion as though it commuted
      with another vector part.}  The noncommutativity is exactly the
      antisymmetry of the cross product.

\item \textbf{Confusing the quaternion product with a 4-D dot product.}
      Quaternion multiplication is bilinear but returns another quaternion and
      includes the oriented three-dimensional cross product.

\item \textbf{Swapping $L(p)$ and $R(p)$ in software.}  Left multiplication and
      right multiplication have different sign patterns.

\item \textbf{Using ``right-handed quaternion'' as a sufficient specification.}
      State an equation such as $\mathbf i\mathbf j=\mathbf k$ and identify the
      physical frame handedness separately.
\end{enumerate}

\section{Exercises}

\begin{enumerate}
\item Let
\[
p=(1,[2,-1,3]^T),
\qquad
q=(2,[-1,4,0]^T).
\]
Compute $pq$ using equation (2).

\item For the same $p$ and $q$, compute $qp$ without repeating the entire
component expansion.  Verify equation (28).

\item Embed
\[
\mathbf a=2\mathbf i-\mathbf j+2\mathbf k,
\qquad
\mathbf b=\mathbf i+3\mathbf j-2\mathbf k
\]
as pure quaternions.  Compute $\mathbf a\mathbf b$ and identify its scalar and
vector parts.

\item Prove directly from equation (11) that
\[
\mathbf a^2=-\lVert\mathbf a\rVert^2
\]
for every pure quaternion $\mathbf a$.

\item Suppose $\mathbf a$ and $\mathbf b$ are nonzero pure quaternions.  Show
that they commute if and only if the corresponding three-dimensional vectors
are parallel.

\item Prove equations (32) and (33) by adding and subtracting
$\mathbf a\mathbf b$ and $\mathbf b\mathbf a$.

\item Let $\mathbf a$ and $\mathbf b$ be perpendicular unit vectors and define
$\mathbf c=\mathbf a\mathbf b$.  Show that $\mathbf c$ is a pure unit quaternion
perpendicular to both $\mathbf a$ and $\mathbf b$, and show that
$\mathbf b\mathbf a=-\mathbf c$.

\item A source uses the same right-handed Cartesian cross product as
PhysicsLibrary but defines a product $\star$ such that
\[
(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).
\]
Evaluate $\mathbf i\star\mathbf j$.  Is this Hamilton multiplication?

\item Verify equation (58) by multiplying $L(p)[q]_{\mathrm{PL}}$ and comparing
all four components with equation (22).

\item In a mechanics problem,
\[
\mathbf r=(1,2,0)\ \mathrm m,
\qquad
\mathbf F=(4,-1,3)\ \mathrm N.
\]
Compute the pure-quaternion product $\mathbf r\mathbf F$.  Interpret its vector
part physically.
\end{enumerate}

\section{Solutions}

\subsection*{1. General product}

The dot product is
\[
\mathbf p\cdot\mathbf q
=2(-1)+(-1)(4)+3(0)=-6.
\]
Hence the scalar part is
\[
1(2)-(-6)=8.
\]
The cross product is
\[
\begin{bmatrix}2\\-1\\3\end{bmatrix}
\times
\begin{bmatrix}-1\\4\\0\end{bmatrix}
=
\begin{bmatrix}-12\\-3\\7\end{bmatrix}.
\]
The vector part is
\[
1\begin{bmatrix}-1\\4\\0\end{bmatrix}
+2\begin{bmatrix}2\\-1\\3\end{bmatrix}
+\begin{bmatrix}-12\\-3\\7\end{bmatrix}
=
\begin{bmatrix}-9\\-1\\13\end{bmatrix}.
\]
Therefore
\[
\boxed{pq=(8,[-9,-1,13]^T).}
\]

\subsection*{2. Reverse order and commutator}

The scalar part is again $8$.  Reversing the order changes only the cross term,
so
\[
\operatorname{Vec}(qp)
=
\begin{bmatrix}-1\\4\\0\end{bmatrix}
+2\begin{bmatrix}2\\-1\\3\end{bmatrix}
-\begin{bmatrix}-12\\-3\\7\end{bmatrix}
=
\begin{bmatrix}15\\5\\-1\end{bmatrix}.
\]
Thus
\[
\boxed{qp=(8,[15,5,-1]^T).}
\]
Also
\[
pq-qp=(0,[-24,-6,14]^T),
\]
while
\[
2\mathbf p\times\mathbf q
=2[-12,-3,7]^T=[-24,-6,14]^T,
\]
which verifies equation (28).

\subsection*{3. Product of two pure quaternions}

Compute
\[
\mathbf a\cdot\mathbf b
=2(1)+(-1)(3)+2(-2)=-5,
\]
so the scalar part is $5$.  The cross product is
\[
\begin{bmatrix}2\\-1\\2\end{bmatrix}
\times
\begin{bmatrix}1\\3\\-2\end{bmatrix}
=
\begin{bmatrix}-4\\6\\7\end{bmatrix}.
\]
Therefore
\[
\boxed{
\mathbf a\mathbf b
=5-4\mathbf i+6\mathbf j+7\mathbf k.
}
\]
The scalar part is $5=-\mathbf a\cdot\mathbf b$, and the vector part is
$\mathbf a\times\mathbf b$.

\subsection*{4. Square of a pure quaternion}

Set $\mathbf b=\mathbf a$ in equation (11):
\[
\mathbf a^2
=-\mathbf a\cdot\mathbf a+\mathbf a\times\mathbf a.
\]
Since $\mathbf a\times\mathbf a=\mathbf0$ and
$\mathbf a\cdot\mathbf a=\lVert\mathbf a\rVert^2$,
\[
\boxed{\mathbf a^2=-\lVert\mathbf a\rVert^2.}
\]

\subsection*{5. When pure quaternions commute}

From equation (28), specialized to pure quaternions,
\[
\mathbf a\mathbf b-\mathbf b\mathbf a
=2\mathbf a\times\mathbf b.
\]
Thus $\mathbf a\mathbf b=\mathbf b\mathbf a$ if and only if
$\mathbf a\times\mathbf b=\mathbf0$.  For nonzero three-dimensional vectors,
this occurs if and only if the vectors are parallel.

\subsection*{6. Recovering the dot and cross products}

Using
\[
\mathbf a\mathbf b=-\mathbf a\cdot\mathbf b+\mathbf a\times\mathbf b,
\]
and
\[
\mathbf b\mathbf a=-\mathbf a\cdot\mathbf b-\mathbf a\times\mathbf b,
\]
addition gives
\[
\mathbf a\mathbf b+\mathbf b\mathbf a=-2\mathbf a\cdot\mathbf b,
\]
so
\[
\boxed{
\mathbf a\cdot\mathbf b
=-\frac12(\mathbf a\mathbf b+\mathbf b\mathbf a).
}
\]
Subtraction gives
\[
\mathbf a\mathbf b-\mathbf b\mathbf a=2\mathbf a\times\mathbf b,
\]
so
\[
\boxed{
\mathbf a\times\mathbf b
=\frac12(\mathbf a\mathbf b-\mathbf b\mathbf a).
}
\]

\subsection*{7. Orthogonal unit pure quaternions}

Because $\mathbf a\perp\mathbf b$,
\[
\mathbf a\cdot\mathbf b=0,
\]
and therefore
\[
\mathbf c=\mathbf a\mathbf b=\mathbf a\times\mathbf b.
\]
The cross product of perpendicular unit vectors is a unit vector perpendicular
to both.  Hence $\mathbf c$ is a pure unit quaternion perpendicular to
$\mathbf a$ and $\mathbf b$.  Reversing the order gives
\[
\mathbf b\mathbf a
=\mathbf b\times\mathbf a
=-\mathbf a\times\mathbf b
=-\mathbf c.
\]

\subsection*{8. Identifying flipped multiplication}

For pure basis vectors,
\[
\mathbf i\star\mathbf j
=-(\mathbf i\times\mathbf j)
=-\mathbf k.
\]
Thus
\[
\boxed{\mathbf i\star\mathbf j=-\mathbf k.}
\]
It is not Hamilton multiplication.  It is the opposite/flipped product relative
to the PhysicsLibrary convention.

\subsection*{9. Left-multiplication matrix}

Multiplying equation (58) by
\[
[q]_{\mathrm{PL}}=
\begin{bmatrix}q_w&amp;q_x&amp;q_y&amp;q_z\end{bmatrix}^{T}
\]
gives
\[
\begin{bmatrix}
 p_wq_w-p_xq_x-p_yq_y-p_zq_z\\
 p_xq_w+p_wq_x-p_zq_y+p_yq_z\\
 p_yq_w+p_zq_x+p_wq_y-p_xq_z\\
 p_zq_w-p_yq_x+p_xq_y+p_wq_z
\end{bmatrix},
\]
which is exactly equation (22), with terms merely reordered within ordinary
real scalar sums.

\subsection*{10. Position--force product}

The dot product is
\[
\mathbf r\cdot\mathbf F
=1(4)+2(-1)+0(3)=2\ \mathrm{N\,m}.
\]
The cross product is
\[
\mathbf r\times\mathbf F
=
\begin{bmatrix}1\\2\\0\end{bmatrix}
\times
\begin{bmatrix}4\\-1\\3\end{bmatrix}
=
\begin{bmatrix}6\\-3\\-9\end{bmatrix}\ \mathrm{N\,m}.
\]
Therefore
\[
\boxed{
\mathbf r\mathbf F
=-2+6\mathbf i-3\mathbf j-9\mathbf k
\quad (\mathrm{N\,m}).
}
\]
Its vector part is the torque about the origin:
\[
\boxed{
\boldsymbol\tau
=6\mathbf i-3\mathbf j-9\mathbf k\ \mathrm{N\,m}.
}
\]

\section{What comes next}

The scalar--vector product makes the next algebraic operations nearly
automatic.  The following PhysicsLibrary entry develops quaternion conjugation,
norm, and inverse.  In particular, the conjugate reverses the vector part,
\[
q^*=q_w-\mathbf q,
\]
and equation (2) will show directly that
\[
qq^*=q^*q=q_w^2+\lVert\mathbf q\rVert^2.
\]
That result leads to the multiplicative inverse and then to unit quaternions,
which are the objects used to represent three-dimensional rotations.

\section{Sources and historical notes}

Joly's \emph{A Manual of Quaternions} develops a quaternion explicitly as the
sum of a scalar and a vector and treats the product of two vectors through its
scalar and vector parts.  In Joly's historical notation, the vector part of the
product corresponds to the oriented vector product while the scalar part carries
the sign convention inherited from Hamilton multiplication.

Macfarlane's \emph{Vector Analysis and Quaternions} is a useful historical
bridge to modern engineering notation because it treats vector analysis and
quaternions as complementary descriptions and organizes separate articles on
products of vectors and composition of rotations.  Hathaway's \emph{A Primer
of Quaternions} supplies elementary examples involving scalar and vector parts,
conjugation, reversed products, and the fundamental Hamilton basis relations.

The derivations, worked examples, implementation matrices, exercises, and
solutions in this PhysicsLibrary entry are newly written in modern notation.

\begin{thebibliography}{9}

\bibitem{Joly1905}
C. J. Joly,
\emph{A Manual of Quaternions},
Macmillan and Co., London, 1905.
Public-domain historical source.
\PMlinkexternal{Internet Archive search}{https://archive.org/search?query=title\%3A\%22A+Manual+of+Quaternions\%22+AND+creator\%3A\%22Joly\%22}

\bibitem{Macfarlane1906}
A. Macfarlane,
\emph{Vector Analysis and Quaternions},
John Wiley \&amp; Sons, New York, 1906.
Public-domain historical source; Project Gutenberg TeX edition available.
\PMlinkexternal{Project Gutenberg edition}{https://www.gutenberg.org/ebooks/13609}

\bibitem{Hathaway1896}
A. S. Hathaway,
\emph{A Primer of Quaternions}, 1896.
Public-domain text; Project Gutenberg edition and \LaTeX{} source available.
\PMlinkexternal{Project Gutenberg edition}{https://www.gutenberg.org/ebooks/9934}

\bibitem{KellandTait1882}
P. Kelland and P. G. Tait,
\emph{Introduction to Quaternions, with Numerous Examples}, 2nd ed.,
Macmillan and Co., London, 1882.
Public-domain historical source.
\PMlinkexternal{HathiTrust copy}{https://hdl.handle.net/2027/uc2.ark:/13960/t6g15wg8x}

\bibitem{WikibooksQuat}
Wikibooks contributors,
``Abstract Algebra/Quaternions.''
Openly licensed instructional source; consult the current page history and
license notice for attribution requirements.
\PMlinkexternal{Wikibooks quaternion article}{https://en.wikibooks.org/wiki/Abstract_Algebra/Quaternions}

\end{thebibliography}

\section*{License}

Unless otherwise noted, this PhysicsLibrary entry is intended for release under
the Creative Commons Attribution--ShareAlike 4.0 International license.</content>
</record>
