I am trying to implement a Rotation matrix showing that intrinsic rotations equal extrinsic rotations, with a simple reordering of matrix arguments and angles.
From wikipedia, "Any extrinsic rotation is equivalent to an intrinsic rotation by the same angles but with inverted order of elemental rotations, and vice versa."
Let $Rx$,$Ry$,$Rz$ be the common Rotation matrices given in the literature and wiki link.
Let $\alpha$, $\beta$,$\gamma$ be the angles by which the Rotations are rotated about the axes.
Suppose I use a Z-X-Z extrinsic convention. Then I have $R$ = $Rz(\gamma$)$Rx(\beta$)$Rz(\alpha$). Physically, this means I Rotate an object in the order,starting from the rightmost angle to the left and get a resulting Rotation matrix, $R$.
If I then use a z-x'-z'' intrinsic convention, I would swap angles and get $R$ =$Rz(\alpha$)$Rx(\beta$)$Rz(\gamma$). Meaning, on the intrinsic (movable) axis, I start rotating by the $\gamma$ angle about the $Zaxis$ and continue to the left.
My understanding is both Rotations should be mathematically equivalent.
Yet when I try to use concrete values like ($\alpha$,$\beta$,$\gamma$) = (45,30,15) degrees, respectively, I get two different answers depending on the method.
Running the models in R I get for Extrinsic:
> round(Rz(D2R(angles[3]))%*%Rx(D2R(angles[2]))%*%Rz(D2R(angles[1])),4)
> [,1] [,2] [,3]
> [1,] 0.5245 -0.8415 0.1294
> [2,] 0.7745 0.4085 -0.4830
> [3,] 0.3536 0.3536 0.8660
Intrinsic:
> round(Rz(D2R(angles[1]))%*%Rx(D2R(angles[2]))%*%Rz(D2R(angles[3])),4)
> [,1] [,2] [,3]
> [1,] 0.5245 -0.7745 0.3536
> [2,] 0.8415 0.4085 -0.3536
> [3,] 0.1294 0.4830 0.8660
Note that the Rotations are not equivalent, but similar. If I transpose the Intrinsic result, they are even closer -- the absolute values are exact.
> round(t(Rz(D2R(angles[1]))%*%Rx(D2R(angles[2]))%*%Rz(D2R(angles[3]))),4)
[,1] [,2] [,3]
[1,] 0.5245 0.8415 0.1294
[2,] -0.7745 0.4085 0.4830
[3,] 0.3536 -0.3536 0.8660
Even though the values are correct, now the signs are wrong. If I lastly convert the angles to negative values, the answers line up perfectly.
> round(t(Rz(D2R(-angles[1]))%*%Rx(D2R(-angles[2]))%*%Rz(D2R(-angles[3]))),4)
[,1] [,2] [,3]
[1,] 0.5245 -0.8415 0.1294
[2,] 0.7745 0.4085 -0.4830
[3,] 0.3536 0.3536 0.8660
So, concretely, the Rotation matrices will be equal if I equate
$Rz(\gamma$)$Rx(\beta$)$Rz(\alpha$) = ($Rz(-\alpha$)$Rx(-\beta$)$Rz(-\gamma$))$^T$
Extrinsic being the left side, and intrinsic being the right. I've looked high and low in the literature and questions here, but i still don't understand why this is the case, and have not found any concrete examples that show this. I have seen some examples showing to invert or transpose one frame to get the other, but nothing about negative angles. Can someone explain why this is true?
*D2R in my code is just a function to convert degrees to radians.
edit. I should also add that I"m aware the negative angles alone imply clockwise (lefthand) rotation. I still don't get the equivalence of intrinsic to extrinsic though.