# Planar intersections

Show 40 post(s) from this thread on one page
Page 3 of 3 First 123
• Jan 28th 2011, 07:28 AM
Ackbeet
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.
• Jan 28th 2011, 07:36 AM
conorc
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?)
• Jan 28th 2011, 08:00 AM
Ackbeet
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.
• Jan 28th 2011, 08:23 AM
conorc
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?
• Jan 28th 2011, 08:45 AM
Ackbeet
I don't think it matters. Just pick one and be consistent.
• Jan 28th 2011, 08:56 AM
conorc
great, thanks again for all your help.
• Jan 28th 2011, 08:59 AM
Ackbeet
You're welcome!
Show 40 post(s) from this thread on one page
Page 3 of 3 First 123