• Advertisement
Sign in to follow this  

wtf unit cross product

This topic is 3926 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So i'm in the middle of programming collision detection routines, and I am doing a cross product of two unit vectors: u1 = < 0.5, .866, 0.0 > u2 = < 0.0, 1.0, 0.0 > u1 x u2 = < 0.0, 0.0, -0.5 > | u1 x u2 | = 0.5 // ??? It was my understanding that the cross product of two unit vectors is always another unit vector, but this is clearly not the case. I did the math twice using my math library and a calculator, so it's not that. does anybody have an explanation for this behavior, or is there some condition for that assumption that i'm missing?

Share this post


Link to post
Share on other sites
Advertisement
MathWorld. Equations 6 and 7 should answer your question: |u x v| = |u| |v| sin(uv).

The fact that the result varies with the orientation of u and v is to be expected: as u overlaps with v, you suddenly get (0,0,0), which would be a "hop" (discontinuation? I don't know the correct English term) if u x v would be constant. And since computing the cross product does not involve operations which can suddenly introduce such hops... (ignore this last paragraph if it's not clear what I mean)

Share this post


Link to post
Share on other sites
The cross product of two unit vectors is a unit vector only if they are perpendicular. If they are parallel the cross product is zero. The general rule is

| u1 x u2 | = | u1 | | u2 | sin t

where t is the angle between the vectors. If they are both unit vectors this reduces to

| u1 x u2 | = sin t

, which is what you have, and from which you can work out the angle between the vectors.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement