Search code examples
matrixscipyrotationscipy-spatial

Compostion of rotation matrix and its inverse


I am using scipy.spatial transform library.

When i compose rotation matrix in xyz manner for angle [45, 45,45 ] then why inverse [-45,-45,-45] is correct when i select "zyx". and why it's wrong when I select "xyz". Am i doing anything wrong? or my understadings is wrong related to composition and decompostion of matrix? enter image description here


Solution

  • This is because if you want to undo transformation in the reverse order that they are done.

    Think about the Ctrl-Z in your computer, each time you undo something you are only undoing the last transformation, in order to undo correctly something you must start with the final stat of when the transformation was applied.

    In matrix algebra, we have inv inv(ABC) = inv(C)inv(B)inv(A), not necessarily the same as inv(A)inv(B)inv(C), because matrix products are not commutative..