# Obtaining rotation matrix from Euler angles if all three rotations happen at once. Does order of multiplication matter?

I'm having a problem getting my head around Euler Angles.

Specifically if I wish to obtain a rotation matrix for a system where pitch, roll and yaw have all changed at once by various values... how does one go about this?

http://mathworld.wolfram.com/EulerAngles.html

It looks like one can express this as:

R = roll[] * pitch[] * yaw[]


But I also read a post where someone said it depends on the order in which they are rotated... which kind of makes sense given that the order of multiplication of matrices affects the output. But this leaves me at a dead end!

Thank you for any help.

Edit: This specifically is being applied to an accelerometer problem to find a_linear:

a_measured = a_linear + g*R[]


I'm assuming that I want roll/pitch/yaw but not entirely sure if I've got my frame of references mixed up :s

• As you say, the Euler angles are noncommutative: this means that saying roll, pitch and yaw all change at once doesn't make sense. You have to pick an order. Can you provide more details about what you're trying to do? – Frederick Mar 15 '14 at 19:07
• Just updated things but basically... I need to find the linear vertical acceleration of 3 axis accelerometer. I would be taking the yaw (or equivilant?) as close to 0 given the gestures being investigated. – user3394391 Mar 15 '14 at 19:12