Sign in to follow this  
Aressera

wtf unit cross product

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this