The correct formulation of two consecutive yaw, pitch, roll, translation transformations

rotationstransformation

I want to project a 3D point using the rotation-translation matrix R:

$$R=\begin{pmatrix} \begin{matrix} { r }_{ 11 } & { r }_{ 12 } & { r }_{ 13 } & x \\ { r }_{ 21 } & { r }_{ 22 } & { r }_{ 23 } & y \\ { r }_{ 31 } & { r }_{ 32 } & { r }_{ 33 } & z \\ 0 & 0 & 0 & 1 \end{matrix} \end{pmatrix}$$

I need to do two transformations, both consisting of a composition of rotations (in this order: yaw, pitch roll) and a translation.

First transformation:

  1. Rotate yaw, pitch, roll
  2. Translate x, y, z

Second transformation with respect to the system that is obtained after the first transformation:

  1. Rotate gamma, beta, alpha (yaw, pitch, roll with other values)
  2. Translate a, b, c

Is this the correct way to do it?

$$\begin{pmatrix} { P }_{ x } \\ { P }_{ y } \\ { P }_{ z } \\ 1 \end{pmatrix}= \begin{pmatrix} \begin{matrix} { r }_{ 11 } & { r }_{ 12 } & { r }_{ 13 } & x \\ { r }_{ 21 } & { r }_{ 22 } & { r }_{ 23 } & y \\ { r }_{ 31 } & { r }_{ 32 } & { r }_{ 33 } & z \\ 0 & 0 & 0 & 1 \end{matrix} \end{pmatrix}\cdot\begin{pmatrix} \begin{matrix} { h }_{ 11 } & { h }_{ 12 } & { h }_{ 13 } & a \\ { h }_{ 21 } & { h }_{ 22 } & { h }_{ 23 } & b \\ { h }_{ 31 } & { h }_{ 32 } & { h }_{ 33 } & c \\ 0 & 0 & 0 & 1 \end{matrix} \end{pmatrix}\cdot\begin{pmatrix} { p }_{ x } \\ { p }_{ y } \\ { p }_{ z } \\ 1 \end{pmatrix}$$

where the $r_{ij}$ are the first three combined rotations, and the $h_{ij}$ are the second three combined rotations.

Best Answer

You can reason as follows: multiplying on the left some vector by a transformation matrix has the effect of rotating and translating the coordinate frame to which the point is "attached". If you multiply the result by another matrix on the left, you rotated and translate both the transformed frame and the attached point. The global effect is indeed the chaining of the two transformations, performed in the order $H$ then $R$.