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

<record version="4" id="1097">
 <title>rotating vectors with quaternions</title>
 <name>RotatingVectorsWithQuaternions</name>
 <created>2026-08-23 20:47:19</created>
 <modified>2026-08-26 05:31:12</modified>
 <type>Topic</type>
 <creator id="1" name="bloftin"/>
 <modifier id="1" name="bloftin"/>
 <author id="1" name="bloftin"/>
 <classification>
	<category scheme="pacs" code="02.40.Yy"/>
	<category scheme="pacs" code="02.10.Hh"/>
 </classification>
 <keywords>
	<term>quaternion</term>
	<term>vector rotation</term>
	<term>unit quaternion</term>
	<term>Rodrigues formula</term>
	<term>pure quaternion</term>
	<term>active rotation</term>
	<term>passive rotation</term>
	<term>rigid-body attitude</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>\section*{Rotating Vectors with Quaternions}

Unit quaternions provide a compact way to transform vector coordinates between
rotated orthonormal frames.  The same algebra also describes active rotation
of a physical vector, but the two interpretations use inverse quaternions for
the same positive geometric rotation.

PhysicsLibrary takes the passive frame map as the canonical attitude
interpretation.  If frame $B$ is obtained from frame $A$ by a positive frame
rotation through angle $\theta$ about the unit axis
$\widehat{\mathbf u}$, then

\begin{equation}
{}^{B}q_A
=
\cos\frac{\theta}{2}
-
\widehat{\mathbf u}\sin\frac{\theta}{2}.
\end{equation}

A fixed physical vector $v$ whose coordinates in frame $A$ are
${}^{A}v$ has coordinates in frame $B$

\begin{equation}
{}^{B}v
=
{}^{B}q_A\,
{}^{A}v\,
({}^{B}q_A)^*.
\end{equation}

The vector is represented inside the quaternion product as a pure quaternion
with zero scalar part.

Equation (2) is the central result of this article.  The derivation below shows
that it is exactly equivalent to the passive form of Rodrigues' rotation
formula,

\begin{equation}
{}^{B}\mathbf v
=
{}^{A}\mathbf v\cos\theta
-
\left(
\widehat{\mathbf u}\times{}^{A}\mathbf v
\right)\sin\theta
+
\widehat{\mathbf u}
\left(
\widehat{\mathbf u}\cdot{}^{A}\mathbf v
\right)
(1-\cos\theta).
\end{equation}

The minus sign on the cross product term is expected: the physical vector is
fixed while the coordinate frame rotates positively.

\section{Convention declaration}

PhysicsLibrary uses Hamilton multiplication,

\[
\mathbf i\mathbf j=\mathbf k,
\qquad
\mathbf j\mathbf k=\mathbf i,
\qquad
\mathbf k\mathbf i=\mathbf j,
\]

with reversed products changing sign.

A quaternion is written scalar first,

\begin{equation}
q
=
q_w+\mathbf q
\quad\longleftrightarrow\quad
\begin{bmatrix}
q_w\\
q_x\\
q_y\\
q_z
\end{bmatrix}.
\end{equation}

For two quaternions

\[
p=(p_w,\mathbf p),
\qquad
q=(q_w,\mathbf q),
\]

Hamilton multiplication is

\begin{equation}
pq
=
\left(
p_wq_w-\mathbf p\cdot\mathbf q,\;
p_w\mathbf q+q_w\mathbf p+\mathbf p\times\mathbf q
\right).
\end{equation}

The canonical frame quaternion ${}^{B}q_A$ maps coordinates from $A$ into
$B$.  Frame chains therefore follow

\begin{equation}
{}^{C}q_A
=
{}^{C}q_B\,{}^{B}q_A.
\end{equation}

The active rotor for the corresponding positive physical vector rotation is
the inverse,

\begin{equation}
q_{\mathrm{active}}
=
({}^{B}q_A)^*
=
\cos\frac{\theta}{2}
+
\widehat{\mathbf u}\sin\frac{\theta}{2}.
\end{equation}

Keeping these two quaternions distinct prevents most sign mistakes in vector
rotation formulas.

\section{Vectors as pure quaternions}

A Cartesian vector

\[
\mathbf v
=
v_x\widehat{\mathbf x}
+
v_y\widehat{\mathbf y}
+
v_z\widehat{\mathbf z}
\]

is embedded in quaternion algebra as the pure quaternion

\begin{equation}
v
=
0
+
v_x\mathbf i
+
v_y\mathbf j
+
v_z\mathbf k.
\end{equation}

In scalar first component form,

\begin{equation}
[v]_{\mathrm{PL}}
=
\begin{bmatrix}
0\\
v_x\\
v_y\\
v_z
\end{bmatrix}.
\end{equation}

The zero scalar part is important.  The vector is not stored as an arbitrary
four component quantity; it is embedded in the pure quaternion subspace.

For a pure quaternion $v$,

\begin{equation}
v^*=-v.
\end{equation}

Its quaternion norm equals the ordinary Euclidean vector magnitude,

\begin{equation}
\lVert v\rVert
=
\sqrt{
v_x^2+v_y^2+v_z^2
}.
\end{equation}

\section{Why the sandwich product preserves purity}

Let

\[
q=(q_w,\mathbf q)
\]

be a unit quaternion and let

\[
v=(0,\mathbf v)
\]

be pure.  Consider

\[
v'=qvq^*.
\]

Conjugating the complete product gives

\[
(v')^*
=
(qvq^*)^*.
\]

Conjugation reverses factor order:

\[
(v')^*
=
qv^*q^*.
\]

Since $v^*=-v$,

\[
(v')^*
=
-qvq^*
=
-v'.
\]

Therefore

\begin{equation}
(v')^*=-v',
\end{equation}

which means $v'$ is also pure.

Thus a unit quaternion sandwich maps ordinary three dimensional vectors back
into the pure quaternion subspace.

\section{Why the sandwich product preserves vector magnitude}

For a unit quaternion,

\[
\lVert q\rVert
=
\lVert q^*\rVert
=
1.
\]

Quaternion norm multiplicativity gives

\[
\begin{aligned}
\lVert qvq^*\rVert
&amp;=
\lVert q\rVert
\lVert v\rVert
\lVert q^*\rVert\\
&amp;=
\lVert v\rVert.
\end{aligned}
\]

Therefore

\begin{equation}
\lVert{}^{B}v\rVert
=
\lVert{}^{A}v\rVert.
\end{equation}

A passive quaternion coordinate transformation changes only the components used
to describe the vector.  Its physical Euclidean length is unchanged.

\section{Derivation of the passive vector transformation}

Let

\begin{equation}
q
=
{}^{B}q_A
=
c-s\widehat{\mathbf u},
\end{equation}

where

\[
c=\cos\frac{\theta}{2},
\qquad
s=\sin\frac{\theta}{2}.
\]

Then

\begin{equation}
q^*
=
c+s\widehat{\mathbf u}.
\end{equation}

Let the input vector be the pure quaternion $\mathbf v$.

First multiply $q$ by $\mathbf v$.  Using the scalar vector Hamilton product,

\begin{equation}
q\mathbf v
=
\left(
s\,\widehat{\mathbf u}\cdot\mathbf v,\;
c\mathbf v
-
s\,\widehat{\mathbf u}\times\mathbf v
\right).
\end{equation}

Now multiply by $q^*$.  The scalar part of the final product cancels, and the
vector part becomes

\begin{equation}
\begin{aligned}
\mathbf v_B
={}&amp;
(c^2-s^2)\mathbf v\\
&amp;-2cs
\left(
\widehat{\mathbf u}\times\mathbf v
\right)\\
&amp;+2s^2
\widehat{\mathbf u}
\left(
\widehat{\mathbf u}\cdot\mathbf v
\right).
\end{aligned}
\end{equation}

Using

\[
c^2-s^2=\cos\theta,
\]

\[
2cs=\sin\theta,
\]

and

\[
2s^2=1-\cos\theta,
\]

gives

\begin{equation}
\mathbf v_B
=
\mathbf v\cos\theta
-
(\widehat{\mathbf u}\times\mathbf v)\sin\theta
+
\widehat{\mathbf u}
(\widehat{\mathbf u}\cdot\mathbf v)
(1-\cos\theta).
\end{equation}

Restoring the frame labels,

\begin{equation}
{}^{B}\mathbf v
=
{}^{A}\mathbf v\cos\theta
-
(\widehat{\mathbf u}\times{}^{A}\mathbf v)\sin\theta
+
\widehat{\mathbf u}
(\widehat{\mathbf u}\cdot{}^{A}\mathbf v)
(1-\cos\theta).
\end{equation}

This is the passive Rodrigues formula.

\section{Geometric interpretation of the passive Rodrigues formula}

Decompose the vector into components parallel and perpendicular to the rotation
axis:

\begin{equation}
\mathbf v
=
\mathbf v_{\parallel}
+
\mathbf v_{\perp},
\end{equation}

where

\begin{equation}
\mathbf v_{\parallel}
=
\widehat{\mathbf u}
(\widehat{\mathbf u}\cdot\mathbf v)
\end{equation}

and

\begin{equation}
\mathbf v_{\perp}
=
\mathbf v-\mathbf v_{\parallel}.
\end{equation}

The component parallel to the axis is unchanged.  The perpendicular component
is resolved along two perpendicular directions,

\[
\mathbf v_{\perp}
\]

and

\[
\widehat{\mathbf u}\times\mathbf v.
\]

Equation (19) can therefore be written

\begin{equation}
\mathbf v_B
=
\mathbf v_{\parallel}
+
\mathbf v_{\perp}\cos\theta
-
(\widehat{\mathbf u}\times\mathbf v)\sin\theta.
\end{equation}

The negative sine term expresses the coordinate motion opposite the positive
frame rotation.


\begin{figure}[ht]
\begin{center}
\includegraphics[width=0.97\textwidth]{Q07_quaternion_vector_rotation-v5.png}
\end{center}
\caption{Passive quaternion vector transformation in the PhysicsLibrary
convention.  Frame $B$ is obtained from frame $A$ by a positive rotation
through angle $\theta$ about $\widehat{\mathbf u}$, so the canonical frame
quaternion is
${}^{B}q_A=\cos(\theta/2)-\widehat{\mathbf u}\sin(\theta/2)$.
A fixed physical vector is represented by different coordinate columns in the
two frames and transforms according to
${}^{B}\mathbf v={}^{B}q_A\,{}^{A}\mathbf v\,({}^{B}q_A)^*$.
The equivalent passive Rodrigues formula carries the negative cross product
term because the basis rotates positively while the physical vector remains
fixed.}
\label{fig:q07_passive_quaternion_vector_rotation}
\end{figure}

Figure \ref{fig:q07_passive_quaternion_vector_rotation} provides a compact
visual summary of the passive coordinate interpretation used throughout this
entry.

\section{Worked check: positive \(90^\circ\) frame rotation about \(+z\)}


Let frame $B$ be obtained from frame $A$ by a positive $90^\circ$ frame
rotation about $+\widehat{\mathbf z}$.

Then

\[
\widehat{\mathbf u}=\mathbf k,
\qquad
\theta=90^\circ,
\]

and

\begin{equation}
{}^{B}q_A
=
\frac{\sqrt2}{2}
-
\frac{\sqrt2}{2}\mathbf k.
\end{equation}

Take the fixed physical vector with frame $A$ coordinates

\begin{equation}
{}^{A}v=\mathbf i.
\end{equation}

The passive Rodrigues formula gives

\[
\mathbf k\cdot\mathbf i=0
\]

and

\[
\mathbf k\times\mathbf i=\mathbf j.
\]

Therefore

\begin{equation}
{}^{B}v
=
-\mathbf j.
\end{equation}

Thus

\[
\begin{bmatrix}
1\\
0\\
0
\end{bmatrix}_{A}
\longrightarrow
\begin{bmatrix}
0\\
-1\\
0
\end{bmatrix}_{B}.
\]

Nothing physical has rotated.  The coordinates changed because the frame axes
rotated positively.

\section{Direct quaternion multiplication for the same check}

Let

\[
a=\frac{\sqrt2}{2}.
\]

Then

\[
{}^{B}q_A
=
a(1-\mathbf k),
\qquad
({}^{B}q_A)^*
=
a(1+\mathbf k).
\]

First,

\[
\begin{aligned}
{}^{B}q_A\,\mathbf i
&amp;=
a(1-\mathbf k)\mathbf i\\
&amp;=
a(\mathbf i-\mathbf k\mathbf i)\\
&amp;=
a(\mathbf i-\mathbf j).
\end{aligned}
\]

Then

\[
\begin{aligned}
{}^{B}q_A\,\mathbf i\,({}^{B}q_A)^*
&amp;=
a^2
(\mathbf i-\mathbf j)(1+\mathbf k)\\
&amp;=
\frac12
\left(
\mathbf i-\mathbf j
+\mathbf i\mathbf k
-\mathbf j\mathbf k
\right)\\
&amp;=
\frac12
\left(
\mathbf i-\mathbf j
-\mathbf j-\mathbf i
\right)\\
&amp;=
-\mathbf j.
\end{aligned}
\]

The direct Hamilton multiplication agrees with the passive Rodrigues formula.

\section{The corresponding active vector rotation}

Now hold the coordinate frame fixed and physically rotate the vector through
the same positive angle $\theta$ about the same axis.

The active rotor is the conjugate of the passive frame quaternion:

\begin{equation}
q_{\mathrm{active}}
=
({}^{B}q_A)^*
=
\cos\frac{\theta}{2}
+
\widehat{\mathbf u}\sin\frac{\theta}{2}.
\end{equation}

The active vector rotation is

\begin{equation}
v'
=
q_{\mathrm{active}}\,
v\,
q_{\mathrm{active}}^*.
\end{equation}

Repeating the derivation with the positive vector part gives the familiar
active Rodrigues formula,

\begin{equation}
\mathbf v'
=
\mathbf v\cos\theta
+
(\widehat{\mathbf u}\times\mathbf v)\sin\theta
+
\widehat{\mathbf u}
(\widehat{\mathbf u}\cdot\mathbf v)
(1-\cos\theta).
\end{equation}

Thus the passive and active formulas differ only in the sign of the sine term
when the same positive geometric angle and axis are used.

For a positive $90^\circ$ active rotation about $+z$,

\[
\mathbf i\longrightarrow\mathbf j,
\]

while for the corresponding positive $90^\circ$ frame rotation,

\[
{}^{A}\mathbf v=\mathbf i
\quad\longrightarrow\quad
{}^{B}\mathbf v=-\mathbf j.
\]

These statements are not contradictory.  One rotates the physical vector; the
other rotates the coordinate frame.

\section{Inverse transformation}

Starting from the passive map

\begin{equation}
{}^{B}v
=
{}^{B}q_A\,{}^{A}v\,({}^{B}q_A)^*,
\end{equation}

multiply on the left by $({}^{B}q_A)^*$ and on the right by
${}^{B}q_A$.

Since the frame quaternion is unit,

\[
({}^{B}q_A)^*{}^{B}q_A=1.
\]

Therefore

\begin{equation}
{}^{A}v
=
({}^{B}q_A)^*
\,{}^{B}v\,
{}^{B}q_A.
\end{equation}

Using

\[
{}^{A}q_B
=
({}^{B}q_A)^*,
\]

this becomes

\begin{equation}
{}^{A}v
=
{}^{A}q_B\,{}^{B}v\,({}^{A}q_B)^*.
\end{equation}

The same sandwich structure is retained; only the frame quaternion is inverted.

\section{Quaternion sign ambiguity}

A unit quaternion and its negative represent the same coordinate
transformation.

Because

\[
(-q)^*=-q^*,
\]

we have

\[
\begin{aligned}
(-q)v(-q)^*
&amp;=
(-q)v(-q^*)\\
&amp;=
qvq^*.
\end{aligned}
\]

Therefore

\begin{equation}
q
\quad\hbox{and}\quad
-q
\end{equation}

produce exactly the same vector transformation.

This double representation matters in numerical attitude estimation and
interpolation because a sign change in the quaternion array does not imply a
physical attitude jump.

\section{Vector only implementation}

The sandwich product can be evaluated without explicitly constructing two full
quaternion products.

Let

\[
q=(q_w,\mathbf q)
\]

be any unit Hamilton quaternion used in

\[
v'=qvq^*.
\]

Expanding the sandwich product gives

\begin{equation}
\mathbf v'
=
\mathbf v
+
2q_w(\mathbf q\times\mathbf v)
+
2\mathbf q\times
(\mathbf q\times\mathbf v).
\end{equation}

Define

\begin{equation}
\mathbf t
=
2(\mathbf q\times\mathbf v).
\end{equation}

Then

\begin{equation}
\mathbf v'
=
\mathbf v
+
q_w\mathbf t
+
\mathbf q\times\mathbf t.
\end{equation}

This form is useful in software because it uses only vector additions, scalar
multiplications, and cross products.

For the canonical passive frame quaternion,

\[
\mathbf q
=
-\widehat{\mathbf u}\sin\frac{\theta}{2},
\]

so the same implementation automatically produces the passive sign.  No
special passive version of Hamilton multiplication is required.

\section{Matrix form}

Define the cross product matrix of a vector $\mathbf a$ by

\begin{equation}
[\mathbf a]_{\times}
=
\begin{bmatrix}
0&amp;-a_z&amp;a_y\\
a_z&amp;0&amp;-a_x\\
-a_y&amp;a_x&amp;0
\end{bmatrix},
\end{equation}

so that

\[
[\mathbf a]_{\times}\mathbf v
=
\mathbf a\times\mathbf v.
\]

For a unit quaternion

\[
q=(q_w,\mathbf q),
\]

the sandwich product corresponds to the matrix

\begin{equation}
C(q)
=
(q_w^2-\mathbf q\cdot\mathbf q)I
+
2\mathbf q\mathbf q^T
+
2q_w[\mathbf q]_{\times}.
\end{equation}

Thus

\begin{equation}
\mathbf v'
=
C(q)\mathbf v.
\end{equation}

For the passive frame quaternion

\[
q
=
\cos\frac{\theta}{2}
-
\widehat{\mathbf u}\sin\frac{\theta}{2},
\]

equation (37) reduces to

\begin{equation}
{}^{B}C_A
=
I\cos\theta
+
(1-\cos\theta)
\widehat{\mathbf u}\widehat{\mathbf u}^{T}
-
[\widehat{\mathbf u}]_{\times}\sin\theta.
\end{equation}

Therefore

\begin{equation}
{}^{B}\mathbf v
=
{}^{B}C_A\,{}^{A}\mathbf v
\end{equation}

is exactly equivalent to the quaternion sandwich in equation (2).

The inverse matrix relation is

\begin{equation}
{}^{A}C_B
=
({}^{B}C_A)^T
=
C(({}^{B}q_A)^*).
\end{equation}

\section{A vector parallel to the rotation axis}

If

\[
\mathbf v
=
\lambda\widehat{\mathbf u},
\]

then

\[
\widehat{\mathbf u}\times\mathbf v=0
\]

and

\[
\widehat{\mathbf u}\cdot\mathbf v=\lambda.
\]

The passive Rodrigues formula becomes

\[
\begin{aligned}
\mathbf v_B
&amp;=
\lambda\widehat{\mathbf u}\cos\theta
+
\lambda\widehat{\mathbf u}(1-\cos\theta)\\
&amp;=
\lambda\widehat{\mathbf u}.
\end{aligned}
\]

Therefore

\begin{equation}
\mathbf v_B=\mathbf v.
\end{equation}

The rotation axis is an eigenvector of the coordinate transformation with
eigenvalue one.

\section{A vector perpendicular to the rotation axis}

If

\[
\widehat{\mathbf u}\cdot\mathbf v=0,
\]

then the passive Rodrigues formula reduces to

\begin{equation}
\mathbf v_B
=
\mathbf v\cos\theta
-
(\widehat{\mathbf u}\times\mathbf v)\sin\theta.
\end{equation}

The transformed coordinates remain in the plane perpendicular to the rotation
axis.

For the corresponding active rotation,

\begin{equation}
\mathbf v'
=
\mathbf v\cos\theta
+
(\widehat{\mathbf u}\times\mathbf v)\sin\theta.
\end{equation}

The opposite signs again reflect inverse geometric operations.

\section{Why unit norm is required}

Suppose one attempts to use

\[
r=\alpha q
\]

with $q$ unit and real $\alpha\neq1$.

Then

\[
r^*=\alpha q^*
\]

and

\[
\begin{aligned}
rvr^*
&amp;=
(\alpha q)v(\alpha q^*)\\
&amp;=
\alpha^2 qvq^*.
\end{aligned}
\]

Therefore

\begin{equation}
\lVert rvr^*\rVert
=
\alpha^2\lVert v\rVert.
\end{equation}

The conjugate sandwich represents a pure orthogonal transformation only for a
unit quaternion.

For a general nonzero quaternion, a similarity transformation can instead be
written

\begin{equation}
v'
=
rvr^{-1}.
\end{equation}

Since

\[
r^{-1}
=
\frac{r^*}{\lVert r\rVert^2},
\]

the scale factor then cancels.  Orientation calculations normally avoid this
extra division by maintaining the attitude quaternion at unit norm.

\section{Implementation checks}

A quaternion vector transformation routine should pass several simple tests.

\begin{enumerate}

\item \textbf{Identity.}

For $q=1$,

\[
qvq^*=v.
\]

\item \textbf{Positive passive \(90^\circ\) about \(+z\).}

Using

\[
{}^{B}q_A
=
\frac{\sqrt2}{2}
-
\frac{\sqrt2}{2}\mathbf k,
\]

the fixed vector with ${}^{A}v=\mathbf i$ must give

\[
{}^{B}v=-\mathbf j.
\]

\item \textbf{Positive active \(90^\circ\) about \(+z\).}

Using the conjugate rotor,

\[
q_{\mathrm{active}}
=
\frac{\sqrt2}{2}
+
\frac{\sqrt2}{2}\mathbf k,
\]

the physical vector must transform as

\[
\mathbf i\longrightarrow\mathbf j.
\]

\item \textbf{Axis invariance.}

A vector parallel to the rotation axis must remain unchanged.

\item \textbf{Norm preservation.}

For unit $q$,

\[
\lVert qvq^*\rVert=\lVert v\rVert.
\]

\item \textbf{Quaternion sign.}

Replacing $q$ by $-q$ must not change the output vector.

\item \textbf{Inverse.}

Applying $q$ and then $q^*$ in the corresponding inverse frame map must recover
the original coordinates.

\end{enumerate}

These checks detect sign, multiplication order, normalization, and active
versus passive mistakes quickly.

\section{Common pitfalls}

\begin{enumerate}

\item \textbf{Using the active quaternion sign for the canonical passive frame
map.}

For a positive frame rotation,

\[
{}^{B}q_A
=
\cos\frac{\theta}{2}
-
\widehat{\mathbf u}\sin\frac{\theta}{2}.
\]

The conjugate has the positive vector sign and is the corresponding active
rotor.

\item \textbf{Using the wrong sandwich order.}

PhysicsLibrary's canonical passive map is

\[
{}^{B}v
=
{}^{B}q_A\,{}^{A}v\,({}^{B}q_A)^*.
\]

The inverse map uses the conjugate quaternion as the new frame quaternion.

\item \textbf{Forgetting the pure quaternion embedding.}

The vector entering the sandwich product has zero scalar part.

\item \textbf{Assuming \(q\) and \(-q\) represent different orientations.}

They produce the same sandwich transformation.

\item \textbf{Using a nonunit quaternion with the conjugate sandwich.}

A nonunit scale changes vector magnitude unless the true inverse is used.

\item \textbf{Changing Hamilton multiplication to obtain a passive
transformation.}

No multiplication change is needed.  PhysicsLibrary retains Hamilton
multiplication and encodes the passive frame direction in the quaternion
definition and frame labels.

\item \textbf{Confusing coordinate motion with physical vector motion.}

For the same positive axis and angle, a passive frame rotation produces the
inverse coordinate motion of the corresponding active vector rotation.

\item \textbf{Copying Rodrigues' formula without checking the interpretation.}

The active formula has a positive cross product sine term.  The PhysicsLibrary
passive coordinate formula has a negative cross product sine term.

\end{enumerate}

\section{Relationship to adjacent PhysicsLibrary entries}

The preceding article, \emph{Axis Angle Representation and Unit Quaternion},
constructs the passive frame quaternion

\[
{}^{B}q_A
=
\cos\frac{\theta}{2}
-
\widehat{\mathbf u}\sin\frac{\theta}{2}.
\]

The present article shows how that quaternion acts on vector coordinates and
derives its Rodrigues and matrix forms.

A separate companion entry,
\emph{Rotating Vectors with Quaternions: Examples, Exercises, and Solutions},
provides the self study problem bank using the same passive convention.

The next main article, \emph{Composition of Rotations and Quaternion Order},
uses the sandwich action developed here to derive composition order, frame
chains, intrinsic sequences, and the noncommutativity of finite rotations.

\section{Sources and convention notes}

The quaternion sandwich transformation is classical.  Hamilton, Joly, and
Hathaway develop quaternion rotation through conjugation by a unit quaternion
or versor.  Modern engineering sources often state the same algebra using
active vector rotations.  PhysicsLibrary retains Hamilton multiplication but
takes the passive frame coordinate map as the canonical attitude object.

Sommer and coauthors provide a useful modern discussion of Hamilton versus
flipped quaternion multiplication and the interaction between multiplication
convention and passive attitude mappings.  The derivations in this entry are
written specifically for the PhysicsLibrary passive convention.

\begin{thebibliography}{9}

\bibitem{Hamilton1899}
W. R. Hamilton,
\emph{Elements of Quaternions}, 2nd ed.,
edited by C. J. Joly,
Longmans, Green, and Co., 1899.
Public domain historical source.
\PMlinkexternal{Internet Archive scan}
{https://archive.org/details/elementsofquater01hamiuoft}

\bibitem{Joly1905}
C. J. Joly,
\emph{A Manual of Quaternions},
Macmillan and Co., London, 1905.
Public domain historical source.
\PMlinkexternal{Internet Archive scan}
{https://archive.org/details/manualofquaterni00jolyrich}

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

\bibitem{Sommer2018}
H. Sommer, I. Gilitschenski, M. Bloesch, S. Weiss, R. Siegwart, and J. Nieto,
``Why and How to Avoid the Flipped Quaternion Multiplication,''
\emph{Aerospace}, vol. 5, no. 3, article 72, 2018.
Published under CC BY 4.0.
\PMlinkexternal{Publisher article}
{https://www.mdpi.com/2226-4310/5/3/72}

\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>
