Skip to content

Euler Angles

Published On:
Feb 20, 2019
Last Updated:
Jul 2, 2026

Euler angles are a way of describing a rotation in 3D space using three separate rotations, each around a single axis.

Syntax

Euler angles are usually defined using one of two symbol sets:

  • α,β,γ\alpha, \beta, \gamma (alpha, beta, gamma). These are usually used with proper Euler angles (see below).
  • ϕ,θ,ψ\phi, \theta, \psi (phi, theta, psi). These are usually used with Tait-Bryan angles (see below).

Proper Euler Angles vs. Tait-Bryan Angles

Euler angles can be split into two categories based on the axis used:

  • Proper Euler Angles: These use the same axis for both the first and third rotations, e.g. x-y-x, x-z-x, y-x-y, y-z-y, z-x-z, z-y-z
  • Tait-Bryan Angles: These use all three axes (no axis is used twice), e.g. x-y-z, x-z-y, y-x-z, y-z-x, z-x-y, z-y-x

Proper Euler angles are also called classic Euler angles.

The classic roll, pitch, yaw (RPY) terminology is a Tait-Bryan angle. Tait-Bryan angles are also called Cardan angles, nautical angles, or heading, elevation and bank.

The axes of the initial frame (also called the reference frame) are denoted with x, y, z. The rotated frame is denoted with X, Y, Z.

The line of nodes is the line (or vector) made by the intersection of the xy and XY planes.

Calculating The Rotation Between Two 3D Vectors

First we calculate the cross-product of the two vectors, which gives us the axis of rotation:

N=a×b\mathbf{N} = \mathbf{a} \times \mathbf{b}

The angle of rotation comes from the dot product:

cosθ=abab\cos{\theta} = \frac{\mathbf{a} \cdot \mathbf{b}}{|\mathbf{a}|\,|\mathbf{b}|}

If you are using unit vectors, you can ignore the lengths (this would just divide by 1).

Together, N\mathbf{N} and θ\theta form an axis-angle representation of the rotation, which can then be converted to Euler angles if needed.

Conversion To Rotation Matrices

Euler angles can be converted to rotation matrices.

Rx(γ)=[1000cosγsinγ0sinγcosγ]\mathbf{R_x(\gamma)} = \begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos{\gamma} & -\sin{\gamma} \\ 0 & \sin{\gamma} & \cos{\gamma} \end{bmatrix} Ry(β)=[cosβ0sinβ010sinβ0cosβ]\mathbf{R_y(\beta)} = \begin{bmatrix} \cos{\beta} & 0 & \sin{\beta} \\ 0 & 1 & 0 \\ -\sin{\beta} & 0 & \cos{\beta} \end{bmatrix} Rz(α)=[cosαsinα0sinαcosα0001]\mathbf{R_z(\alpha)} = \begin{bmatrix} \cos{\alpha} & -\sin{\alpha} & 0 \\ \sin{\alpha} & \cos{\alpha} & 0 \\ 0 & 0 & 1 \end{bmatrix}

We can combine these to form a single rotation matrix:

R(α,β,γ)=Rz(α)Ry(β)Rx(γ)\mathbf{R(\alpha, \beta, \gamma)} = \mathbf{R_z(\alpha)} \mathbf{R_y(\beta)} \mathbf{R_x(\gamma)}

Remember that these are proper matrix multiplications! This order performs the roll, then the pitch, then the yaw. These are extrinsic rotations.

Once the rotation matrix has been calculated, you can rotate any point/vector in the original reference frame to the rotated frame with the equation:

[x1y1z1]=R[x0y0z0]\begin{bmatrix}x_1 \\ y_1 \\ z_1\end{bmatrix} = \mathbf{R} \begin{bmatrix}x_0 \\ y_0 \\ z_0\end{bmatrix}

Conversion From Rotation Matrices

α=atan2(r32,r33)β=arcsin(r31)γ=atan2(r21,r11)\begin{align*} \alpha &= \operatorname{atan2}(r_{32}, r_{33}) \\ \beta &= -\arcsin(r_{31}) \\ \gamma &= \operatorname{atan2}(r_{21}, r_{11}) \end{align*}

where atan2(y,x)\operatorname{atan2}(y, x) returns the principal angle.

Euler angles suffer from gimbal lock when the second rotation approaches ±90\pm 90^{\circ}quaternions are a popular alternative representation that avoids this problem and interpolates smoothly.