Confusion about the order of rotations when using rotation matrixes

27 Views Asked by At

I am studying rotations matrixes and I'm confused about the order of rotations.

Let's say I would like to rotate vector $\vec a$ into $\vec b$. They are defined in the cartesian coordinate system. I would like to do the rotation first around the $x$ axis, then the $y$ axis, and then the $z$ axis. Does that mean I need to write:

$$R_z R_y R_x \vec a = \vec b \tag 1$$

instead of

$$R_x R_y R_z \vec a = \vec b \tag 2$$

Am I correct? The way I understand is, in equation $(1)$ first the vector $\vec a$ is multiplied with $R_x$ which means it is rotated around the $x$ axis, then that vector is multiplied with $R_y$ which is a rotation around the y axis and then finally the rotation around the $z$ axis is done.