Euler Angles
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). These are usually used with proper Euler angles (see below).
- (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:
The angle of rotation comes from the dot product:
If you are using unit vectors, you can ignore the lengths (this would just divide by 1).
Together, and 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.
We can combine these to form a single rotation matrix:
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:
Conversion From Rotation Matrices
where returns the principal angle.
Euler angles suffer from gimbal lock when the second rotation approaches — quaternions are a popular alternative representation that avoids this problem and interpolates smoothly.

