Why when rotating a matrix you multiply it by the rotation and the transposed of the rotation matrix?

562 Views Asked by At

I have the matrix:

    |x 0 0|
A = |0 y 0|
    |0 0 z|

which represents axis of a cube for example. Now I want to rotate my cube along along y, so I have the rotation matrix along y:

     |cos(a)   0   sin(a)|
Ry = |0        1        0|
     |-sin(a)  0   cos(a)|

I had thought I'd only need to multiply them as:

A' = A*Ry

And this would give me the new rotated x and z values.

However, I have found some documentation saying that it should actually be:

A' = Ry*A*RyT

where RyT is the transpose of Ry. Anyone can tell me if this is accurate as I can't find more info on it and if so why do I need to do this? I still have the outside axis x, y and z at the same position, however the cuboid is rotated, if that makes sense.