matthew-brett / transforms3d

3 dimensional spatial transformations
http://matthew-brett.github.io/transforms3d/
Other
465 stars 83 forks source link

Error in euler2mat in taitbryan.py #11

Closed agnarhs closed 8 years ago

agnarhs commented 8 years ago

Hello,

I have just started using transforms3d and just discovered some strange behaviour of my rotation matrices being returned from euler2mat in taitbryan.py.

As far as I see the statement return reduce(np.dot, Ms[::-1]) reverses the order of the rotation matrices in Ms and you end up with Rx_Ry_Rz, which is wrong. It should be Rz_Ry_Rx. If the statment is changed to reduce(np.dot, Ms), everything is in order.

best regards, Agnar

matthew-brett commented 8 years ago

It might be wrong, but I think the code implements z rotation followed by y rotation followed by x rotation, and, this is Rx.dot(Ry.dot(Rz)), with matrix multiplication reading from right to left.

matthew-brett commented 8 years ago

(Sorry, just fixed a typo in my reply).

agnarhs commented 8 years ago

Hello,

you are absolutely right. My mistake.

regards, Agnar