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

<record version="3" id="1103">
 <title>quaternions and Euler angles</title>
 <name>QuaternionsAndEulerAngles</name>
 <created>2026-08-24 01:56:23</created>
 <modified>2026-08-27 04:07:35</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"/>
	<category scheme="pacs" code="45.40.-f"/>
 </classification>
 <keywords>
	<term>quaternion</term>
	<term>Euler angles</term>
	<term>yaw pitch roll</term>
	<term>321 sequence</term>
	<term>Tait-Bryan angles</term>
	<term>gimbal lock</term>
	<term>attitude parameterization</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).
% If you use \includegraphics{figure} with no file extension, PhysicsLibrary
% will prefer figure.png before falling back to figure.eps.
\usepackage{graphicx}
\DeclareGraphicsExtensions{.png,.jpg,.jpeg,.pdf,.eps}
% 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*{Quaternions and Euler Angles}

Euler angles and quaternions are two common descriptions of three dimensional
orientation.

Euler angles are intuitive because they build an orientation from a sequence
of elementary rotations.  In aerospace applications, yaw, pitch, and roll are
especially familiar.  Quaternions are less intuitive geometrically, but they
are compact, compose efficiently, propagate naturally from angular velocity,
and avoid the coordinate singularity of an Euler angle chart.

The main difficulty in converting between them is not the algebra.  It is
convention management.

This article uses the PhysicsLibrary passive frame convention and develops the
intrinsic moving axis $3$-$2$-$1$ yaw, pitch, roll sequence.

Let

\[
\psi=\text{yaw},
\qquad
\theta=\text{pitch},
\qquad
\phi=\text{roll}.
\]

The intrinsic sequence is:

\begin{enumerate}

\item rotate the frame by yaw $\psi$ about the original $3$ axis;

\item rotate by pitch $\theta$ about the new moving $2$ axis;

\item rotate by roll $\phi$ about the final moving $1$ axis.

\end{enumerate}

Under the PhysicsLibrary passive convention, the resulting frame
transformation from $A$ coordinates into $B$ coordinates is

\begin{equation}
{}^{B}C_A
=
C_1(\phi)
C_2(\theta)
C_3(\psi).
\end{equation}

The matching unit quaternion is

\begin{equation}
{}^{B}q_A
=
q_1^{P}(\phi)
q_2^{P}(\theta)
q_3^{P}(\psi).
\end{equation}

The quaternion and DCM therefore use the same written order.

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

Quaternion components are displayed scalar first:

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

The canonical passive attitude quaternion maps coordinate components according
to

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

For a positive frame rotation through angle $\alpha$ about a positive unit
axis $\mathbf e_i$,

\begin{equation}
q_i^{P}(\alpha)
=
\cos\frac{\alpha}{2}
-
\mathbf e_i\sin\frac{\alpha}{2}.
\end{equation}

The corresponding elementary passive DCM is denoted $C_i(\alpha)$.

The reverse frame quaternion and DCM satisfy

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

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

\section{Euler angle families}

Three angle orientation sequences are commonly divided into two families.

\begin{enumerate}

\item \textbf{Proper Euler sequences} repeat one axis.  Examples include
$3$-$1$-$3$ and $1$-$2$-$1$.

\item \textbf{Tait Bryan sequences} use three different axes.  Examples
include $3$-$2$-$1$ and $1$-$2$-$3$.

\end{enumerate}

The aerospace yaw, pitch, roll sequence treated here is a Tait Bryan sequence.

There are six Tait Bryan sequences and six proper Euler sequences.  Conversion
formulas depend on which one is selected.  A formula for $3$-$2$-$1$ must not
be applied to $1$-$2$-$3$ data merely because the same three angles appear.

\section{Intrinsic and extrinsic language}

An \emph{intrinsic} sequence uses moving axes.  After the first elementary
rotation, the next rotation axis moves with the frame.

An \emph{extrinsic} sequence uses axes fixed in the reference frame.

The intrinsic sequence

\[
3\text{ then }2\text{ then }1
\]

with angles

\[
\psi,\theta,\phi
\]

is geometrically equivalent to an extrinsic sequence about fixed axes

\[
1\text{ then }2\text{ then }3
\]

with angles

\[
\phi,\theta,\psi.
\]

This equivalence does not mean finite rotations commute.  It means the same
final orientation can be described from two different axis viewpoints.

PhysicsLibrary uses intrinsic moving axis language for the aerospace sequence
unless an article explicitly states otherwise.

\section{Elementary passive axis quaternions}

For roll,

\begin{equation}
q_1^{P}(\phi)
=
\cos\frac{\phi}{2}
-
\mathbf i\sin\frac{\phi}{2}.
\end{equation}

For pitch,

\begin{equation}
q_2^{P}(\theta)
=
\cos\frac{\theta}{2}
-
\mathbf j\sin\frac{\theta}{2}.
\end{equation}

For yaw,

\begin{equation}
q_3^{P}(\psi)
=
\cos\frac{\psi}{2}
-
\mathbf k\sin\frac{\psi}{2}.
\end{equation}

The intrinsic $3$-$2$-$1$ frame sequence is therefore represented by

\begin{equation}
{}^{B}q_A
=
q_1^{P}(\phi)
q_2^{P}(\theta)
q_3^{P}(\psi).
\end{equation}

Although yaw occurs first in the moving axis geometric construction, its
elementary quaternion appears at the right of the final passive product.
This is the same order as the associated DCM product.

\section{Step by step geometry}

The following illustration shows the intrinsic moving axis $3$-$2$-$1$
sequence.

% PhysicsLibrary image file expected:
% Q10_euler_sequence.png
%
% Legacy L2H note:
% Keep this as a simple inline include.  Do not wrap it in a figure
% environment and do not use caption, label, or ref macros here.
%
% If the stored image itself contains old active-convention formula text,
% update the image while retaining the filename Q10_euler_sequence.png.
% Pure moving axis geometry remains valid when interpreted as frame rotation.

\begin{center}
\includegraphics[width=0.94\textwidth]{Q10_euler_sequence.png}
\end{center}

\noindent\textbf{Figure.}
The intrinsic $3$-$2$-$1$ yaw, pitch, roll frame sequence.  Step 1 applies a
positive frame yaw $\psi$ about the original $3$ axis.  Step 2 applies a
positive frame pitch $\theta$ about the intermediate moving $2$ axis.  Step 3
applies a positive frame roll $\phi$ about the final moving $1$ axis.  Under
the PhysicsLibrary passive convention,

\[
{}^{B}C_A
=
C_1(\phi)C_2(\theta)C_3(\psi)
\]

and

\[
{}^{B}q_A
=
q_1^{P}(\phi)q_2^{P}(\theta)q_3^{P}(\psi).
\]

\section{Elementary passive rotation matrices}

The passive elementary $1$ axis matrix is

\begin{equation}
C_1(\phi)
=
\begin{bmatrix}
1&amp;0&amp;0\\
0&amp;\cos\phi&amp;\sin\phi\\
0&amp;-\sin\phi&amp;\cos\phi
\end{bmatrix}.
\end{equation}

The passive elementary $2$ axis matrix is

\begin{equation}
C_2(\theta)
=
\begin{bmatrix}
\cos\theta&amp;0&amp;-\sin\theta\\
0&amp;1&amp;0\\
\sin\theta&amp;0&amp;\cos\theta
\end{bmatrix}.
\end{equation}

The passive elementary $3$ axis matrix is

\begin{equation}
C_3(\psi)
=
\begin{bmatrix}
\cos\psi&amp;\sin\psi&amp;0\\
-\sin\psi&amp;\cos\psi&amp;0\\
0&amp;0&amp;1
\end{bmatrix}.
\end{equation}

Each is the transpose of the familiar positive active elementary rotation
matrix for the same axis and angle.

\section{The passive \(3\)-\(2\)-\(1\) DCM}

Introduce

\[
c_\phi=\cos\phi,
\qquad
s_\phi=\sin\phi,
\]

\[
c_\theta=\cos\theta,
\qquad
s_\theta=\sin\theta,
\]

and

\[
c_\psi=\cos\psi,
\qquad
s_\psi=\sin\psi.
\]

Multiplying

\[
{}^{B}C_A
=
C_1(\phi)
C_2(\theta)
C_3(\psi)
\]

gives

\begin{equation}
{}^{B}C_A
=
\begin{bmatrix}
c_\theta c_\psi
&amp;
c_\theta s_\psi
&amp;
-s_\theta
\\
s_\phi s_\theta c_\psi-c_\phi s_\psi
&amp;
s_\phi s_\theta s_\psi+c_\phi c_\psi
&amp;
s_\phi c_\theta
\\
c_\phi s_\theta c_\psi+s_\phi s_\psi
&amp;
c_\phi s_\theta s_\psi-s_\phi c_\psi
&amp;
c_\phi c_\theta
\end{bmatrix}.
\end{equation}

This matrix maps coordinates from the initial frame $A$ into the final frame
$B$.

\section{Quaternion formula for the passive \(3\)-\(2\)-\(1\) sequence}

Introduce the half angle abbreviations

\begin{equation}
c_{\phi/2}
=
\cos\frac{\phi}{2},
\qquad
s_{\phi/2}
=
\sin\frac{\phi}{2},
\end{equation}

\begin{equation}
c_{\theta/2}
=
\cos\frac{\theta}{2},
\qquad
s_{\theta/2}
=
\sin\frac{\theta}{2},
\end{equation}

\begin{equation}
c_{\psi/2}
=
\cos\frac{\psi}{2},
\qquad
s_{\psi/2}
=
\sin\frac{\psi}{2}.
\end{equation}

For compactness in the multiplication below, write

\[
c_\phi^h=c_{\phi/2},
\qquad
s_\phi^h=s_{\phi/2},
\]

and similarly for $\theta$ and $\psi$.

Then

\[
q_1^{P}(\phi)
=
c_\phi^h-\mathbf i s_\phi^h,
\]

\[
q_2^{P}(\theta)
=
c_\theta^h-\mathbf j s_\theta^h,
\]

and

\[
q_3^{P}(\psi)
=
c_\psi^h-\mathbf k s_\psi^h.
\]

Multiplying

\[
{}^{B}q_A
=
q_1^{P}(\phi)
q_2^{P}(\theta)
q_3^{P}(\psi)
\]

gives

\begin{equation}
{}^{B}q_A
=
q_w
+
q_x\mathbf i
+
q_y\mathbf j
+
q_z\mathbf k,
\end{equation}

with

\begin{equation}
q_w
=
c_\phi^h c_\theta^h c_\psi^h
+
s_\phi^h s_\theta^h s_\psi^h,
\end{equation}

\begin{equation}
q_x
=
c_\phi^h s_\theta^h s_\psi^h
-
s_\phi^h c_\theta^h c_\psi^h,
\end{equation}

\begin{equation}
q_y
=
-
c_\phi^h s_\theta^h c_\psi^h
-
s_\phi^h c_\theta^h s_\psi^h,
\end{equation}

\begin{equation}
q_z
=
s_\phi^h s_\theta^h c_\psi^h
-
c_\phi^h c_\theta^h s_\psi^h.
\end{equation}

The scalar component is the same as in the corresponding active quaternion.
The three vector components have the opposite sign because the passive frame
quaternion is the conjugate of the active rotor representing the same final
orientation.

\section{Relation to the active \(3\)-\(2\)-\(1\) rotor}

Let

\[
q_{\mathrm{active}}
\]

be the Hamilton quaternion that actively rotates a physical vector through the
same geometric orientation while the coordinate frame remains fixed.

Then

\begin{equation}
q_{\mathrm{active}}
=
({}^{B}q_A)^*.
\end{equation}

Thus if

\[
{}^{B}q_A
=
q_w+q_x\mathbf i+q_y\mathbf j+q_z\mathbf k,
\]

then

\begin{equation}
q_{\mathrm{active}}
=
q_w-q_x\mathbf i-q_y\mathbf j-q_z\mathbf k.
\end{equation}

Similarly,

\begin{equation}
R_{\mathrm{active}}
=
({}^{B}C_A)^T.
\end{equation}

This is why many published Euler to quaternion formulas have the same scalar
term but the opposite three vector signs from the PhysicsLibrary formulas.

\section{Cross check against the quaternion generated DCM}

The preceding PhysicsLibrary article defines

\[
{}^{B}C_A
=
C({}^{B}q_A).
\]

Substituting equations (21) through (24) into the quaternion generated DCM
must reproduce equation (16).

This provides an important implementation check because the Euler product,
quaternion product, and matrix product are three independently useful ways of
describing the same passive frame transformation:

\begin{equation}
C
\left(
q_1^{P}(\phi)
q_2^{P}(\theta)
q_3^{P}(\psi)
\right)
=
C_1(\phi)
C_2(\theta)
C_3(\psi).
\end{equation}

\section{Recovering roll, pitch, and yaw from the passive DCM}

For the principal nonsingular branch, choose

\begin{equation}
-\frac{\pi}{2}
&lt;
\theta
&lt;
\frac{\pi}{2}.
\end{equation}

From equation (16),

\[
C_{13}=-\sin\theta.
\]

Therefore

\begin{equation}
\theta
=
\arcsin(-C_{13}).
\end{equation}

When $\cos\theta\neq0$,

\[
C_{23}=s_\phi c_\theta
\]

and

\[
C_{33}=c_\phi c_\theta.
\]

Thus

\begin{equation}
\phi
=
\operatorname{atan2}
(C_{23},C_{33}).
\end{equation}

Likewise,

\[
C_{12}=c_\theta s_\psi
\]

and

\[
C_{11}=c_\theta c_\psi,
\]

so

\begin{equation}
\psi
=
\operatorname{atan2}
(C_{12},C_{11}).
\end{equation}

These formulas are often the clearest route from a quaternion to Euler angles:
first generate the passive DCM using Q09, then extract the angles from the
declared DCM sequence.

\section{Recovering roll, pitch, and yaw directly from a quaternion}

Using the passive quaternion generated DCM,

\[
C_{23}
=
2(q_yq_z-q_wq_x),
\]

\[
C_{33}
=
1-2(q_x^2+q_y^2),
\]

\[
C_{13}
=
2(q_xq_z+q_wq_y),
\]

\[
C_{12}
=
2(q_xq_y-q_wq_z),
\]

and

\[
C_{11}
=
1-2(q_y^2+q_z^2).
\]

Therefore the principal $3$-$2$-$1$ angles can be recovered from the
PhysicsLibrary passive quaternion by

\begin{equation}
\phi
=
\operatorname{atan2}
\left(
2(q_yq_z-q_wq_x),
1-2(q_x^2+q_y^2)
\right),
\end{equation}

\begin{equation}
\theta
=
\arcsin
\left(
-2(q_xq_z+q_wq_y)
\right),
\end{equation}

\begin{equation}
\psi
=
\operatorname{atan2}
\left(
2(q_xq_y-q_wq_z),
1-2(q_y^2+q_z^2)
\right).
\end{equation}

These are the passive PhysicsLibrary versions of the familiar active
yaw, pitch, roll extraction formulas.

\section{Check: pure positive yaw}

Let

\[
\phi=0,
\qquad
\theta=0,
\qquad
\psi=\frac{\pi}{2}.
\]

The passive quaternion formula reduces to

\[
q_w
=
\cos\frac{\pi}{4}
=
\frac{\sqrt2}{2},
\]

\[
q_x=q_y=0,
\]

and

\[
q_z
=
-\sin\frac{\pi}{4}
=
-\frac{\sqrt2}{2}.
\]

Therefore

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

The matching DCM is

\begin{equation}
{}^{B}C_A
=
\begin{bmatrix}
0&amp;1&amp;0\\
-1&amp;0&amp;0\\
0&amp;0&amp;1
\end{bmatrix}.
\end{equation}

This agrees with the positive $90^\circ$ passive $z$ frame rotation used as a
convention diagnostic in Q07 through Q09.

\section{Check: pure positive pitch}

Let

\[
\phi=0,
\qquad
\psi=0.
\]

Then

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

The DCM becomes

\begin{equation}
{}^{B}C_A
=
\begin{bmatrix}
\cos\theta&amp;0&amp;-\sin\theta\\
0&amp;1&amp;0\\
\sin\theta&amp;0&amp;\cos\theta
\end{bmatrix}.
\end{equation}

For $\theta=90^\circ$,

\[
{}^{A}\widehat{\mathbf z}
\longrightarrow
{}^{B}(-\widehat{\mathbf x}).
\]

\section{Check: pure positive roll}

Let

\[
\theta=0,
\qquad
\psi=0.
\]

Then

\begin{equation}
{}^{B}q_A
=
\cos\frac{\phi}{2}
-
\mathbf i\sin\frac{\phi}{2}.
\end{equation}

The DCM becomes

\begin{equation}
{}^{B}C_A
=
\begin{bmatrix}
1&amp;0&amp;0\\
0&amp;\cos\phi&amp;\sin\phi\\
0&amp;-\sin\phi&amp;\cos\phi
\end{bmatrix}.
\end{equation}

For $\phi=90^\circ$,

\[
{}^{A}\widehat{\mathbf y}
\longrightarrow
{}^{B}(-\widehat{\mathbf z}).
\]

\section{A nontrivial numerical example}

Take

\[
\phi=20^\circ,
\qquad
\theta=-10^\circ,
\qquad
\psi=30^\circ.
\]

The passive quaternion is obtained from equations (21) through (24).
Numerically,

\[
c_{\phi/2}\approx0.984807753,
\qquad
s_{\phi/2}\approx0.173648178,
\]

\[
c_{\theta/2}\approx0.996194698,
\qquad
s_{\theta/2}\approx-0.087155743,
\]

\[
c_{\psi/2}\approx0.965925826,
\qquad
s_{\psi/2}\approx0.258819045.
\]

Substitution gives approximately

\begin{equation}
{}^{B}q_A
\approx
\begin{bmatrix}
0.943714\\
-0.189308\\
0.038135\\
-0.268536
\end{bmatrix}.
\end{equation}

Converting this quaternion to a DCM and then applying equations (30) through
(32) recovers the original roll, pitch, and yaw values to numerical
roundoff.

This round trip is an important software verification case because all three
angles are nonzero.

\section{Gimbal lock}

Euler angles are local coordinates on the orientation manifold rather than a
global one to one orientation representation.

For the intrinsic $3$-$2$-$1$ sequence, the singularity occurs when

\begin{equation}
\theta
=
\pm\frac{\pi}{2}.
\end{equation}

At these pitch angles,

\[
\cos\theta=0.
\]

The formulas

\[
\phi
=
\operatorname{atan2}(C_{23},C_{33})
\]

and

\[
\psi
=
\operatorname{atan2}(C_{12},C_{11})
\]

lose independent information because both numerator and denominator pairs
collapse.

For

\[
\theta=+\frac{\pi}{2},
\]

the matrix depends on the combination

\[
\phi-\psi.
\]

For

\[
\theta=-\frac{\pi}{2},
\]

it depends on the combination

\[
\phi+\psi.
\]

Thus yaw and roll cannot be determined independently at the singular
configuration.

The physical orientation remains perfectly well defined.  Only the chosen
Euler coordinate chart becomes singular.

Unit quaternions do not have this gimbal lock singularity.

\section{Near the singularity}

Near

\[
|\theta|=\frac{\pi}{2},
\]

small attitude perturbations can produce large numerical changes in the
individual yaw and roll angles.

For estimation, simulation, and control, it is therefore usually preferable
to propagate and update attitude with quaternions or DCMs and convert to Euler
angles primarily for display, operator interfaces, or applications in which
the sequence is physically meaningful.

A robust software conversion should also clamp the argument of $\arcsin$ into
the interval $[-1,1]$ when small floating point errors place it just outside
that range.

\section{Quaternion sign and Euler extraction}

Because

\[
q
\]

and

\[
-q
\]

represent the same orientation, they must produce the same Euler angles on the
same extraction branch.

Every expression in equations (33) through (35) is quadratic in quaternion
components.  Replacing all four components by their negatives leaves those
expressions unchanged.

Therefore

\begin{equation}
\mathrm{Euler}(-q)
=
\mathrm{Euler}(q)
\end{equation}

up to the ordinary nonuniqueness and branch choices of Euler angle
coordinates.

\section{Euler angle nonuniqueness}

Even away from gimbal lock, Euler angle triples are not globally unique.

Angles are periodic.  Adding $2\pi$ to an elementary rotation angle does not
change the physical orientation.

There are also alternative triples associated with different branches of the
inverse trigonometric functions.

For the principal $3$-$2$-$1$ representation, PhysicsLibrary normally chooses

\begin{equation}
-\pi
&lt;
\phi
\leq
\pi,
\end{equation}

\begin{equation}
-\frac{\pi}{2}
\leq
\theta
\leq
\frac{\pi}{2},
\end{equation}

\begin{equation}
-\pi
&lt;
\psi
\leq
\pi,
\end{equation}

with an explicit singularity policy at
$\theta=\pm\pi/2$.

\section{Implementation guidance}

When converting between quaternions and Euler angles in software:

\begin{enumerate}

\item Declare the Euler sequence explicitly.  Do not write only
``yaw pitch roll'' without defining the product.

\item Declare whether the Euler rotations are intrinsic moving axis rotations
or extrinsic fixed axis rotations.

\item Declare the quaternion frame direction.  PhysicsLibrary uses
${}^{B}q_A$ for $A\rightarrow B$ coordinates.

\item Declare Hamilton multiplication separately from scalar first or scalar
last storage.

\item Verify the three pure axis cases.

\item Verify at least one case with all three Euler angles nonzero.

\item Verify quaternion to DCM to Euler and Euler to quaternion to DCM round
trips.

\item Treat gimbal lock explicitly rather than allowing division or
$\operatorname{atan2}(0,0)$ behavior to define the result accidentally.

\item Compare physical orientation rather than raw Euler triples when testing
for equality.

\end{enumerate}

\section{Common pitfalls}

\begin{enumerate}

\item \textbf{Using the old active PhysicsLibrary formulas.}

The current house convention uses passive frame quaternions.  A positive
elementary frame rotation has a negative quaternion vector part.

\item \textbf{Using the active product order for the passive intrinsic
sequence.}

PhysicsLibrary uses

\[
{}^{B}q_A
=
q_1^{P}(\phi)
q_2^{P}(\theta)
q_3^{P}(\psi).
\]

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

The matching matrix is

\[
{}^{B}C_A
=
C_1(\phi)
C_2(\theta)
C_3(\psi).
\]

\item \textbf{Mixing intrinsic and extrinsic descriptions.}

An intrinsic $3$-$2$-$1$ sequence is equivalent to an extrinsic
$1$-$2$-$3$ description with reversed angle order, not to the same verbal
sequence about fixed axes.

\item \textbf{Copying quaternion extraction formulas from an active source.}

The PhysicsLibrary passive formulas have different signs in the terms that are
linear in $q_w$.

\item \textbf{Confusing component storage with quaternion semantics.}

Scalar first versus scalar last storage does not determine Euler sequence,
frame direction, or active versus passive interpretation.

\item \textbf{Ignoring gimbal lock.}

At

\[
\theta=\pm\frac{\pi}{2},
\]

yaw and roll are not independently recoverable.

\item \textbf{Assuming Euler angles are unique.}

Different triples can represent the same physical orientation.

\item \textbf{Comparing \(q\) and \(-q\) as different attitudes.}

They produce the same DCM and the same Euler orientation.

\end{enumerate}

\section{Relationship to adjacent PhysicsLibrary entries}

The preceding article, \emph{Quaternions and Direction Cosine Matrices},
establishes

\[
{}^{B}C_A
=
C({}^{B}q_A)
\]

and gives the passive quaternion generated matrix.

The present article combines that DCM relation with an intrinsic moving axis
$3$-$2$-$1$ sequence to derive yaw, pitch, roll conversion in both
directions.

The separate examples entry,
\emph{Quaternions and Euler Angles: Examples, Exercises, and Solutions},
should use the same passive formulas developed here.

The next main article, \emph{Quaternion Kinematics and Angular Velocity},
derives the differential equations that propagate the passive frame
quaternion from body or reference resolved angular velocity.

\section{Sources and convention notes}

Euler angle conversion formulas are particularly sensitive to frame direction,
sequence order, intrinsic versus extrinsic language, and active versus passive
interpretation.  A formula should therefore be accompanied by its defining
matrix or quaternion product.

Henderson provides an important aerospace reference for Euler angle,
quaternion, and transformation matrix relationships.  Moore provides an
openly licensed modern treatment of reference frame orientation.  Sommer and
coauthors provide a useful convention analysis for Hamilton versus flipped
quaternion multiplication and passive frame transformations.

\begin{thebibliography}{9}

\bibitem{Henderson1977}
D. M. Henderson,
\emph{Euler Angles, Quaternions, and Transformation Matrices:
Working Relationships},
JSC-12960,
NASA Johnson Space Center,
Mission Planning and Analysis Division,
1977.
Engineering reference.
\PMlinkexternal{NASA Technical Reports Server search}
{https://ntrs.nasa.gov/search?q=JSC-12960}

\bibitem{MooreLMD}
J. K. Moore,
\emph{Learn Multibody Dynamics},
chapter ``Orientation of Reference Frames.''
Distributed under CC BY 4.0.
\PMlinkexternal{Learn Multibody Dynamics}
{https://moorepants.github.io/learn-multibody-dynamics/orientation.html}

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

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

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