Euler Angle Conventions

While we all know that any 3D orientation can be achieved using 3 sequential rotations, order and reference frame used for these are very important, different choices lead to different results and conventions. I will get to the bottom of XYZ ( fixed-frame ) and ZYX ( local-frame ) and explain how to use the "final" resulting rotation matrix.

Fixed-Frame vs. Local-Frame Rotations

XYZ Fixed-Frame Rotations

We perform three rotations in the order X, then Y, then Z, all with respect to the fixed world frame.
Let's derive the final rotation matrix, RXYZ. We start with our body frame aligned with the world frame (R=I).

R1=Rx(α) R2=Ry(β)R1=Ry(β)Rx(α) Rfinal=Rz(γ)R2=Rz(γ)Ry(β)Rx(α)

So, the final rotation matrix for the XYZ fixed-frame convention is RXYZ=Rz(γ)Ry(β)Rx(α). Notice that the matrices are applied in the reverse order of the operations.

ZYX Local-Frame Rotations (Roll-Pitch-Yaw)

This is the more common one, it's called the yaw,pitch,roll , yes and not roll-pitch-yaw as the order in which we multiply is yaw,pitch and roll. That is why it's called ZYX.

final rotation matrix for RZYX.

R1=Rz(α) R2=R1Ry(β)=Rz(α)Ry(β) Rfinal=R2Rx(γ)=Rz(α)Ry(β)Rx(γ)

So, the final rotation matrix for the ZYX local-frame convention is RZYX=Rz(α)Ry(β)Rx(γ). Notice the matrices are applied in the same order as the operations.

The "Why" Behind World (Pre) vs. Local (Post) Multiplication

The entire confusion around pre- and post-multiplication boils down to one simple question: which ruler am I using for the measurement? Am I rotating based on the fixed, unchanging room around me (the World Frame), or am I rotating based on my own, moving perspective (the Local Frame)?

Funny Thingy

We saw how to make from world XYZ and local ZYX, good news is they are actually the same!

Equivalence Relation:

### Why the Final Application is *Always* Pre-Multiplication

This section addresses core question: once we have the final rotation matrix R, how do we use it?

No matter how you derive the final rotation matrix , whether it's from an XYZ fixed-frame sequence, a ZYX local-frame sequence, Rodrigues' formula, or a quaternion .Its purpose is always the same: to transform the coordinates of a point from one frame to another.

The application of this final matrix to a point vector is always a pre-multiplication.

This can feel strange: why are there two ways to build the matrix, but only one way to use it?

The reason is that building the matrix and using the matrix are two fundamentally different jobs.

If you have a point pB defined in a body frame {B}, and you have derived the rotation matrix RWB that describes the orientation of frame {B} relative to the world frame {W}, the coordinates of that same point in the world frame, pW, are found by:

The mathematical transformation of a point is:

pW=RWBpB

By convention in linear algebra, when a matrix operates on a vector, the matrix is written on the left.
So, once my final R is built, I always pre-multiply the point vector by it.