views:

113

answers:

1

Doing a couple rotations in Matlab, one which is rotation about the y-axis, however online I've found two different answers: here and here. Which is correct, if both how does one get to the other?

+3  A: 

The two answers you link to are the same, up to different notation. The angle q in one link corresponds to the angle -a in the other, and since

sin(-q) = -sin(q)

for any q, we have that

sin(a) = -sin(q)

which introduces the difference in sign. The siggraph link also has a 4-dimensional matrix, which allows for translations, but the last row and column of this can be ignored if you want a pure rotation.

Chris Johnson
More generally, they are transposed
ima
Yup. Since rotation matrices are orthogonal, the matrix inverse is equal to the transpose. As rotation about of angle -q is the inverse operation of rotation of q (about the same axis), the change of sign of the rotation angle will always produce the matrix transpose, for any axis of rotation.
Chris Johnson