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

Meta

Talkback

Downloads

Information
Euler angles: 3-2-1 yaw pitch roll (Topic)

Euler Angles: 3-2-1 Yaw Pitch Roll

The intrinsic $3$-$2$-$1$ Euler sequence is the most common Tait Bryan orientation parameterization in aerospace engineering and navigation.

It is usually called yaw pitch roll.

In the PhysicsLibrary convention, the three chronological frame rotations are:

  1. yaw through $\psi$ about axis $3$ of the initial frame;
  2. pitch through $\theta$ about axis $2$ of the first intermediate frame;
  3. roll through $\phi$ about axis $1$ of the second intermediate frame.

The resulting passive coordinate transformation is

$\displaystyle {}^BC_A = C_1(\phi)C_2(\theta)C_3(\psi).$ (1)

This article develops the geometry, matrix, inverse extraction formulas, aerospace sign interpretation, singularity, quaternion equivalent, and angular-velocity relationship for this sequence.

The separate Euler 321 sequence entry remains the compact sequence reference. EA07 is the deeper engineering treatment.

Frame and sign convention

Let $A$ be a reference frame and $B$ the final body frame.

PhysicsLibrary uses the passive coordinate map

$\displaystyle {}^B\mathbf v = {}^BC_A\,{}^A\mathbf v.$ (2)

The physical vector does not change.

Only its coordinate representation changes.

The positive frame rotation itself follows the right hand rule.

For aerospace work, a common specialization is:

  • frame $A$: local navigation North-East-Down coordinates;
  • frame $B$: aircraft body Forward-Right-Down coordinates.

These are both right handed frames.

The FAA describes aircraft roll about the longitudinal axis, pitch about the lateral axis, and yaw about the vertical axis. In the common body-axis notation these correspond to axes $1$, $2$, and $3$, respectively.

Intrinsic 3-2-1 frame construction

Define

$\displaystyle A_0=A. $

After yaw, call the intermediate frame $A_1$.

After pitch, call the next intermediate frame $A_2$.

After roll,

$\displaystyle A_3=B. $
Image EA07_intrinsic_321_frame_chain

Figure. Intrinsic $3$-$2$-$1$ frame chain. Yaw is about $z_A$, pitch is about the moved axis $y_1$, and roll is about the moved axis $x_2$.

The three passive coordinate maps are

$\displaystyle {}^{A_1}C_A = C_3(\psi),$ (3)
$\displaystyle {}^{A_2}C_{A_1} = C_2(\theta),$ (4)

and

$\displaystyle {}^BC_{A_2} = C_1(\phi).$ (5)

Matching adjacent frame labels gives

$\displaystyle {}^BC_A = {}^BC_{A_2} \,{}^{A_2}C_{A_1} \,{}^{A_1}C_A,$ (6)

hence

$\displaystyle {}^BC_A = C_1(\phi)C_2(\theta)C_3(\psi).$ (7)

The rightmost matrix acts first on a coordinate column.

Positive yaw, pitch, and roll

For a conventional aircraft body frame,

$\displaystyle +x=\hbox{forward}, \qquad +y=\hbox{right}, \qquad +z=\hbox{down}. $

Positive frame rotations obey the right hand rule.

Therefore:

  • positive yaw rotates the current $x$ axis toward the current $y$ axis;
  • positive pitch rotates the current $x$ axis toward the negative current $z$ direction, which is nose up in Forward-Right-Down coordinates;
  • positive roll rotates the current $y$ axis toward the current $z$ axis, which is right wing down.
Image EA07_yaw_pitch_roll_positive_directions

Figure. Positive yaw, pitch, and roll directions for the conventional Forward-Right-Down aircraft body-axis interpretation. Each rotation is intrinsic, so the axis used at each step belongs to the current intermediate frame.

Elementary passive matrices

The three required passive frame rotations are

$\displaystyle C_1(\phi) = \begin{bmatrix} 1&0&0\ 0&\cos\phi&\sin\phi\ 0&-\sin\phi&\cos\phi \end{bmatrix},$ (8)
$\displaystyle C_2(\theta) = \begin{bmatrix} \cos\theta&0&-\sin\theta\ 0&1&0\ \sin\theta&0&\cos\theta \end{bmatrix},$ (9)

and

$\displaystyle C_3(\psi) = \begin{bmatrix} \cos\psi&\sin\psi&0\ -\sin\psi&\cos\psi&0\ 0&0&1 \end{bmatrix}.$ (10)

Derivation of the full 3-2-1 DCM

Define

$\displaystyle c_\phi=\cos\phi, \qquad s_\phi=\sin\phi, $

with analogous notation for $\theta$ and $\psi$.

First multiply pitch and yaw:

$\displaystyle C_2(\theta)C_3(\psi) = \begin{bmatrix} c_\theta c_\psi & c_\theta... ...psi & c_\psi & 0\ s_\theta c_\psi & s_\theta s_\psi & c_\theta \end{bmatrix}.$ (11)

Premultiplying by $C_1(\phi)$ gives

$\displaystyle {}^BC_A = \begin{bmatrix} c_\theta c_\psi & c_\theta s_\psi & -s_... ... s_\psi & c_\phi s_\theta s_\psi-s_\phi c_\psi & c_\phi c_\theta \end{bmatrix}.$ (12)

This is the canonical PhysicsLibrary passive intrinsic $3$-$2$-$1$ DCM.

What the rows and columns mean

For

$\displaystyle C={}^BC_A, $

the matrix elements satisfy

$\displaystyle C_{ij} = \mathbf e_i^B\mathbin{\boldsymbol{\cdot}}\mathbf e_j^A.$ (13)

Thus row $i$ contains the body basis vector $\mathbf e_i^B$ expressed in frame $A$ coordinates.

Column $j$ contains the reference basis vector $\mathbf e_j^A$ expressed in frame $B$ coordinates.

For example, the first row is

$\displaystyle {}^A\mathbf e_1^B = \begin{bmatrix} c_\theta c_\psi & c_\theta s_\psi & -s_\theta \end{bmatrix}.$ (14)

This row is the body forward axis expressed in the reference frame.

Yaw and pitch from the body forward axis

Suppose frame $A$ is North-East-Down and frame $B$ is Forward-Right-Down.

The body forward direction expressed in navigation coordinates is

$\displaystyle {}^A\mathbf e_1^B = \begin{bmatrix} c_\theta c_\psi\ c_\theta s_\psi\ -s_\theta \end{bmatrix}.$ (15)

When

$\displaystyle \cos\theta>0, $

yaw is the heading of the horizontal projection:

$\displaystyle \psi = \operatorname{atan2} \left( ({}^A\mathbf e_1^B)_2, ({}^A\mathbf e_1^B)_1 \right).$ (16)

The Down component is

$\displaystyle ({}^A\mathbf e_1^B)_3=-\sin\theta. $

Thus positive pitch gives a negative Down component, corresponding to nose up.

Roll does not change the forward-axis direction because the final roll is about that axis.

Principal angle ranges

A common principal branch is

$\displaystyle -\pi<\psi\leq\pi,$ (17)
$\displaystyle -\frac{\pi}{2} \leq \theta \leq \frac{\pi}{2},$ (18)

and

$\displaystyle -\pi<\phi\leq\pi.$ (19)

On this branch,

$\displaystyle \cos\theta\geq0.$ (20)

Inverse extraction from the DCM

Let

$\displaystyle C = {}^BC_A = \begin{bmatrix} C_{11}&C_{12}&C_{13}\ C_{21}&C_{22}&C_{23}\ C_{31}&C_{32}&C_{33} \end{bmatrix}. $

Away from the singularity,

$\displaystyle \theta = \arcsin(-C_{13}),$ (21)
$\displaystyle \phi = \operatorname{atan2}(C_{23},C_{33}),$ (22)

and

$\displaystyle \psi = \operatorname{atan2}(C_{12},C_{11}).$ (23)

The two-argument function $\operatorname{atan2}$ is essential because it preserves the correct quadrant.

Equivalent atan2 form for pitch

Away from singularity,

$\displaystyle \theta = \operatorname{atan2} \left( -C_{13}, \sqrt{C_{11}^2+C_{12}^2} \right).$ (24)

For a proper DCM,

$\displaystyle \sqrt{C_{11}^2+C_{12}^2} = \vert\cos\theta\vert.$ (25)

On the principal branch this reduces to $\cos\theta$.

The 3-2-1 singularity

The sequence becomes singular when

$\displaystyle \cos\theta=0.$ (26)

Thus

$\displaystyle \theta = \pm\frac{\pi}{2}.$ (27)

At these configurations, the first rotation axis $z_A$ and the third rotation axis $x_2$ become collinear.

Image EA05_tait_bryan_middle_angle_singularity

Figure. Intrinsic $3$-$2$-$1$ singularity. At $\theta=+90^\circ$, $x_2$ is anti-aligned with $z_A$; at $\theta=-90^\circ$, it is aligned with $z_A$.

The physical orientation remains completely valid.

Only the yaw pitch roll coordinate chart becomes singular.

Exact outer-angle coupling at positive ninety degrees

Set

$\displaystyle \theta=+\frac{\pi}{2}. $

Then

$\displaystyle {}^BC_A = \begin{bmatrix} 0&0&-1\ \sin(\phi-\psi)&\cos(\phi-\psi)&0\ \cos(\phi-\psi)&-\sin(\phi-\psi)&0 \end{bmatrix}.$ (28)

Only

$\displaystyle \phi-\psi$ (29)

appears.

Yaw and roll are therefore not independently recoverable.

Exact outer-angle coupling at negative ninety degrees

Set

$\displaystyle \theta=-\frac{\pi}{2}. $

Then

$\displaystyle {}^BC_A = \begin{bmatrix} 0&0&1\ -\sin(\phi+\psi)&\cos(\phi+\psi)&0\ -\cos(\phi+\psi)&-\sin(\phi+\psi)&0 \end{bmatrix}.$ (30)

Only

$\displaystyle \phi+\psi$ (31)

appears.

A practical singular-case convention

Software must choose a convention when

$\displaystyle \vert\cos\theta\vert $

falls below a selected numerical threshold.

One possible policy is to set

$\displaystyle \phi=0 $

at singularity and assign the entire observable outer-angle combination to yaw.

At positive ninety degrees,

$\displaystyle \delta = \operatorname{atan2}(C_{21},C_{22}) = \phi-\psi.$ (32)

With $\phi=0$,

$\displaystyle \psi=-\delta.$ (33)

At negative ninety degrees,

$\displaystyle \sigma = \operatorname{atan2}(-C_{21},C_{22}) = \phi+\psi.$ (34)

With $\phi=0$,

$\displaystyle \psi=\sigma.$ (35)

Another implementation may hold yaw fixed and assign the coupled rotation to roll.

The requirement is not one unique policy; the requirement is an explicit, consistent policy.

Equivalent extrinsic description

Intrinsic $3$-$2$-$1$ with chronological angles $(\psi,\theta,\phi)$ is equivalent to extrinsic $1$-$2$-$3$ with chronological angles $(\phi,\theta,\psi)$:

intrinsic $\displaystyle 3$-$\displaystyle 2$-$\displaystyle 1 (\psi,\theta,\phi) \equiv$   extrinsic $\displaystyle 1$-$\displaystyle 2$-$\displaystyle 3 (\phi,\theta,\psi).$ (36)

Active versus passive 3-2-1 matrices

The PhysicsLibrary matrix is passive:

$\displaystyle {}^B\mathbf v = {}^BC_A\,{}^A\mathbf v. $

The corresponding active rotation matrix is its transpose:

$\displaystyle R_{\rm active} = ({}^BC_A)^T.$ (37)

Therefore an apparently transposed $3$-$2$-$1$ matrix in another reference may be correct under an active-vector convention.

Passive quaternion equivalent

For a positive passive frame rotation about axis $i$,

$\displaystyle q_i^P(\lambda) = \cos\frac{\lambda}{2} - \mathbf e_i\sin\frac{\lambda}{2}.$ (38)

Therefore

$\displaystyle {}^Bq_A = q_1^P(\phi) q_2^P(\theta) q_3^P(\psi).$ (39)

Let

$\displaystyle c_{\phi/2}=\cos\frac{\phi}{2}, \qquad s_{\phi/2}=\sin\frac{\phi}{2}, $

with analogous definitions for $\theta$ and $\psi$.

Under Hamilton multiplication and scalar-first storage,

$\displaystyle {}^Bq_A = \begin{bmatrix} c_{\phi/2}c_{\theta/2}c_{\psi/2} +s_{\p... ...{\phi/2}c_{\theta/2}s_{\psi/2} +s_{\phi/2}s_{\theta/2}c_{\psi/2} \end{bmatrix}.$ (40)

The quaternion and DCM satisfy

$\displaystyle {}^BC_A = C({}^Bq_A).$ (41)

Angular velocity and Euler angle rates

Let

$\displaystyle {}^B\boldsymbol\omega_{B/A} = \begin{bmatrix} p\\ q\\ r \end{bmatrix}$

be the angular velocity of frame $B$ relative to frame $A$, expressed in body coordinates.

For intrinsic $3$-$2$-$1$,

$\displaystyle \begin{bmatrix} p\\ q\\ r \end{bmatrix}= \begin{bmatrix} 1&0&-\si... ... \end{bmatrix}\begin{bmatrix} \dot\phi\ \dot\theta\ \dot\psi \end{bmatrix}.$ (42)

Thus body angular velocity components are not equal to Euler Angle rates except in special cases.

Away from the singularity,

$\displaystyle \begin{bmatrix} \dot\phi\ \dot\theta\ \dot\psi \end{bmatrix}=... ...theta&\cos\phi/\cos\theta \end{bmatrix}\begin{bmatrix} p\\ q\\ r \end{bmatrix}.$ (43)

The inverse rate map becomes singular at the same $\cos\theta=0$ condition.

Euler angles and angular velocity develops this relationship in detail later in the series.

Small-angle approximation

For small yaw, pitch, and roll,

$\displaystyle \sin\lambda\approx\lambda, \qquad \cos\lambda\approx1. $

Then

$\displaystyle {}^BC_A \approx \begin{bmatrix} 1&\psi&-\theta\ -\psi&1&\phi\ \theta&-\phi&1 \end{bmatrix}.$ (44)

If

$\displaystyle \boldsymbol\epsilon = \begin{bmatrix} \phi\ \theta\ \psi \end{bmatrix}, $

then

$\displaystyle {}^BC_A \approx I-[\boldsymbol\epsilon\times].$ (45)

This is a local linearization only.

Finite yaw pitch roll angles are not a rotation vector.

Numerical example

Take

$\displaystyle \psi=30^\circ, \qquad \theta=20^\circ, \qquad \phi=10^\circ.$ (46)

Then

$\displaystyle {}^BC_A = C_1(10^\circ) C_2(20^\circ) C_3(30^\circ)$ (47)

gives

$\displaystyle {}^BC_A \approx \begin{bmatrix} +0.81380 & +0.46985 & -0.34202 \ -0.44097 & +0.88256 & +0.16318 \ +0.37852 & +0.01803 & +0.92542 \end{bmatrix}.$ (48)

The corresponding passive quaternion is approximately

$\displaystyle {}^Bq_A \approx \begin{bmatrix} +0.951549 \ -0.038135 \ -0.189308 \ -0.239298 \end{bmatrix}.$ (49)

The DCM satisfies

$\displaystyle CC^T=I,$ (50)

and

$\displaystyle \det C=1$ (51)

to numerical precision.

Applying the inverse extraction formulas recovers

$\displaystyle (\psi,\theta,\phi) = (30^\circ,20^\circ,10^\circ).$ (52)

Relative attitude should not be found by angle subtraction

Suppose two body attitudes are represented by

$\displaystyle (\psi_1,\theta_1,\phi_1) $

and

$\displaystyle (\psi_2,\theta_2,\phi_2). $

The exact relative attitude is not generally

$\displaystyle (\psi_2-\psi_1,\theta_2-\theta_1,\phi_2-\phi_1). $

Instead form the two DCMs,

$\displaystyle C_1={}^{{B_1}}C_A, \qquad C_2={}^{{B_2}}C_A, $

and compute

$\displaystyle {}^{{B_2}}C_{{B_1}} = C_2C_1^T.$ (53)

Quaternion composition gives the equivalent exact result.

Use in navigation and flight dynamics

The intrinsic $3$-$2$-$1$ sequence is attractive because its coordinates have direct interpretation over normal aircraft operating attitudes.

When $A$ is a local navigation frame and $B$ is the body frame:

  • yaw describes heading-like orientation about the local vertical;
  • pitch describes nose-up or nose-down tilt;
  • roll describes bank about the forward axis.

Practical inertial navigation and flight-control software often propagates a quaternion or DCM internally and converts to yaw pitch roll for displays, interfaces, limits, initialization, or selected control logic.

Convention traps in the literature

A source that says “yaw pitch roll” or “3-2-1” has not yet fully specified its convention.

Determine at least:

  1. intrinsic or extrinsic axes;
  2. active or passive transformation;
  3. coordinate-map direction;
  4. column-vector or row-vector convention;
  5. positive-angle convention;
  6. whether $3$-$2$-$1$ describes chronological rotations or written matrix-factor order;
  7. reference-frame axis directions, such as North-East-Down versus East-North-Up;
  8. body-axis convention, such as Forward-Right-Down.

Many apparent sign disagreements disappear when these choices are aligned.

Verification battery

A correct PhysicsLibrary $3$-$2$-$1$ implementation should satisfy:

  1. zero angles give the identity;
  2. $\theta=\phi=0$ gives $C_3(\psi)$;
  3. $\psi=\phi=0$ gives $C_2(\theta)$;
  4. $\psi=\theta=0$ gives $C_1(\phi)$;
  5. $CC^T=I$;
  6. $\det C=1$;
  7. the reverse map is the transpose;
  8. DCM-to-Euler round trips recover the principal branch away from $\cos\theta=0$;
  9. the DCM agrees with the passive quaternion product;
  10. the Euler-rate inverse becomes singular at the same $\cos\theta=0$ condition.

Summary

The PhysicsLibrary intrinsic $3$-$2$-$1$ yaw pitch roll convention is

$\displaystyle \psi:\ 3_A, \qquad \theta:\ 2_1, \qquad \phi:\ 1_2.$ (54)

Its passive coordinate map is

$\displaystyle {}^BC_A = C_1(\phi)C_2(\theta)C_3(\psi).$ (55)

Away from singularity,

$\displaystyle \theta=\arcsin(-C_{13}),$ (56)
$\displaystyle \phi=\operatorname{atan2}(C_{23},C_{33}),$ (57)

and

$\displaystyle \psi=\operatorname{atan2}(C_{12},C_{11}).$ (58)

The singularity occurs at

$\displaystyle \theta=\pm\frac{\pi}{2},$ (59)

where yaw and roll become coupled.

The equivalent passive quaternion is

$\displaystyle {}^Bq_A = q_1^P(\phi)q_2^P(\theta)q_3^P(\psi).$ (60)

The $3$-$2$-$1$ sequence is therefore an extremely useful local engineering coordinate system, while a quaternion or DCM is usually preferable for global attitude propagation.

The next article, Euler angles: 3-1-3 proper Euler sequence, develops the flagship proper Euler sequence in comparable detail.

References and further reading

Henderson provides the classic NASA engineering development of Euler angles, quaternions, transformation matrices, and the twelve sequence relationships.

The FAA Pilot's Handbook of Aeronautical Knowledge describes aircraft roll, pitch, and yaw about the longitudinal, lateral, and vertical axes.

Diebel gives a unified attitude-representation treatment useful for comparing Euler, DCM, quaternion, and rotation-vector conventions.

SciPy's rotation documentation provides a modern software reference for intrinsic and extrinsic Euler sequence notation.

Bibliography

1
D. M. Henderson, Euler Angles, Quaternions, and Transformation Matrices: Working Relationships, JSC-12960, NASA Johnson Space Center, 1977. NASA Technical Reports Server
2
Federal Aviation Administration, Pilot's Handbook of Aeronautical Knowledge, FAA-H-8083-25C, 2023. FAA Pilot's Handbook of Aeronautical Knowledge
3
J. Diebel, “Representing Attitude: Euler Angles, Unit Quaternions, and Rotation Vectors,” Stanford University, 2006. Online PDF
4
SciPy Developers, “Rotation.from_euler,” SciPy documentation. SciPy Euler rotation documentation

License

Unless otherwise noted, this PhysicsLibrary entry is intended for release under the Creative Commons Attribution ShareAlike 4.0 International license.



"Euler angles: 3-2-1 yaw pitch roll" is owned by bloftin.
(view preamble)
View style:
Keywords:  Euler angles, 3-2-1 sequence, yaw pitch roll, aerospace attitude, NED frame, body frame, passive transformation, intrinsic rotation, direction cosine matrix, gimbal lock

Cross-references: system, quaternion product, identity, composition, relative attitude, Euler Angle, velocity, observable, function, work, representation, vector, reference frame, Euler 321 sequence, quaternion, formulas, matrix

This is version 1 of Euler angles: 3-2-1 yaw pitch roll, born on 2026-08-30.
Object id is 1131, canonical name is EulerAngles321YawPitchRoll.
Accessed 2 times total.

Classification:
Physics Classification45.40.-f (Dynamics and kinematics of rigid bodies)
 02.40.Yy (Geometric mechanics )
 06.30.Gv (Velocity, acceleration, and rotation)
Pending Errata and Addenda
None.
Discussion
Style: Expand: Order:

No messages.

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