# calculation sequences when using RPY-transformation vs Euler-transformation

I have trouble understanding calculation sequences for RPY-transformation and Euler-transformation.
Let's assume that there are 3 (rotation/translation) instructions.
I will notate transformation matrix for instruction 1 as ,
transformation matrix for instruction 2 as ,
transformation matrix for instruction 3 as 

In this situation when using RPY-method, calculation order will be  -> [2 * 1] -> [3 * 2 * 1].
First multiply  and , and then multiply . Right?

When using Euler-method, I am not sure what is correct order.

1.  -> [1 * 2] -> [1 * 2 * 3]
First multiply  and , and then multiply 
2.  -> [3 * 2] -> [3 * 2 * 1]
First multiply  and , and then multiply 

What is correct sequence when calculation Euler-method? Is it 1) or 2) ?
Also I think the resulting 4x4 matrix should be same whether I use RPY or Euler transformation. Is it correct?

I would like to add to your answer a simple concept i used to understand rotation matrices. So, first you rotate the x- axis. No problem here.R=[x]

Second, you rotate the already rotated axes(that was rotated around x) around z. Hence you pre-multiply first matrix by second matrix as it is now changing the previous rotation. Post multiplying here would mean that the frame was rotated around x now affected the rotation around z which is not true. Hence pre-multiplication. Rot. matrix becomes R'=[z][x].

Now, third you rotate already rotated axes (that was rotated first around x and then around z) around y. As your rotation around y affects the previously rotates axes, so you pre-multiply them with y- rotation matrix. Post multiplying would mean that rotation around x and z affects the rotation around y which is not true as frames were rotated around y in the end (not first). New matrix R"=[y][z][x]. So any new rotation around reference frames affects all rotations done before so should be placed first. The first rotated matrix doesn't affect anyone but themselves should be placed last.

I hope that makes sense.

I was quite confused but now got an answer by myself.
Let's assume 3 instructions like below.
#1 rotation about world x axis(reference frame)
#2 rotation about world z axis(reference frame)
#3 rotation about world y axis(reference frame)

When using RPY convention, you process in order of #1 -> #2 -> #3.
Then your matrix will be like 
because in absolute frame, we use pre-multiplication. So new matrix goes to the left side of an existing matrix.

On the other hand, when using Euler convention, you process in order of #3 -> #2 -> #1.
In this case, matrix will also be like 
because in relative frame, we use post-multiplication. So new matrix goes to the right side of an existing matrix.

There is no definitive or concrete definition for what "Euler angles" means. It really varies by field / time period / convention. What's concrete is there are 6 distinct orderings of rotating around three different axes. See https://en.wikipedia.org/wiki/Euler_angles.

Note that rotating intrinsically (angle w.r.t the up-till-now transformed axes) around X, then Y, then Z is the same as rotating extrinsically (angle w.r.t. original axes) around Z, then Y, then X.

Note that what's listed as "Euler angles" in the wikipedia page are actually rotations around axes in the format ABA and "Tait-Bryan angles" are in the "more commonly used" (IMO) format of ABC (three distinct axes).