1. In 2 dimensions, order doesn't matter. But in 3 dimensions, order almost always matters. So make sure you have the order the way you want it. I would take some special cases, easy ones, and just do the rotation in your head to see if they come out right.

Incidentally, your computations in Post # 24 agree with mine. You have successfully computed

$R_{x}(\pi/4)R_{z}(\pi/4),$

which would be (assuming you're always left-multiplying by the matrices) the z rotation followed by the x rotation.

2. im doing it in matlab, but wouldnt it be the other way around? x followed by z?

The order for euler angles and pitch,roll yaw are different. i dont see why, seeing as how they are the same thing..(are they?)

3. No, for 3D rotations, order is absolutely crucial. Think about it. Take a unit vector in the x direction. Rotate it about the z axis in a positive direction through 90 degrees. It's now pointed in the + y direction. Now rotate it about the x axis through 90 degrees, and it'll be pointed in the + z direction.

Now do it the other way: take your unit vector in the x direction. Rotate it about the x axis through 90 degrees. No change! (That's a hint right there that it's not going to be the same.) Now rotate it about the z axis through 90 degrees. It'll now be pointed in the + y direction. So, essentially, I've proven the following:

$R_{x}(\pi/2)\,R_{z}(\pi/2)\,\mathbf{i}=\mathbf{k},$ but

$R_{z}(\pi/2)\,R_{x}(\pi/2)\,\mathbf{i}=\mathbf{j}\not=\mathbf{k}.$

Therefore, it follows that

$R_{x}(\pi/2)\,R_{z}(\pi/2)\not=R_{z}(\pi/2)\,R_{x}(\pi/2).$

Indeed, this is matrix multiplication we're dealing with here, which is not, in general, commutative. So you shouldn't expect to be able to do things in any order you want.

4. Yes, that makes sense, i should have spotted that.

So should i go x*y*z for the pitch roll yaw method, or z*y*x for the euler angle method?

5. I don't think it matters. Just pick one and be consistent.

6. great, thanks again for all your help.

7. You're welcome!

Page 3 of 3 First 123