Aressera 2919 Report post Posted May 22, 2007 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? 0 Share this post Link to post Share on other sites
SamLowry 1865 Report post Posted May 22, 2007 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) 0 Share this post Link to post Share on other sites
johnb 351 Report post Posted May 22, 2007 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 twhere 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. 0 Share this post Link to post Share on other sites
Aressera 2919 Report post Posted May 22, 2007 ok thanks, i'll remember that in the future. 0 Share this post Link to post Share on other sites