bitshit 163 Report post Posted October 13, 2007 Hi, I've been using the crossproduct to calculate the normal vector for two given vectors in 3d space, which I calculate by doing: v × w = (vywz − wyvz, vzwx − wzvx, vxwy − wxvy ) I tried to see why this calculation results in a vector perpendicular to the plane v & w form, but can't figure out why that is. In 2D for 1 vector it is simple enough, you just switch (x,y) with (-y,x)to get a perpendicular vector. But I can't see why the crossproduct does this in 3d for two vectors... Could anyone explain me why? [Edited by - bitshit on October 13, 2007 1:48:29 PM] 0 Share this post Link to post Share on other sites
Wiggin 374 Report post Posted October 13, 2007 This is quite easy to show if you know that the dot product of two non-zero vectors is 0 if and only if they are perpendicular.v * (v x w) = vxvywz - vxwyvz + vyvzwx − vywzvx + vzvxwy − vzwxvy = 0 0 Share this post Link to post Share on other sites
Zipster 2377 Report post Posted October 13, 2007 What you can do is plug the unknown output vector (x,y,z) into the top row of a 3x3 matrix, where the other two rows are the input vectors (vx,vy,vz) and (wx,wy,wz):[ x y z ][ vx vy vz ][ wx wy wz ]We know that the determinant of a matrix should be the hyper-volume of the parallelepiped formed by the vectors of that matrix. Since we want (x,y,z) to be perpendicular to the input vectors, the parallelepiped is going to look like a parallelogram that also has a height, with no sheering. Volume is base area times height. It just so happens that the length of the cross product is both the base area and the height, meaning that |(v x w)|^{2} = volume = determinant (the squared length of the cross product equals the determinant). If we expand the above determinant we get:x(vywz - wyvz) + y(vzwx - vxwz) + z(vxwy - vywx) = determinantClearly, if we let x, y, and z equal their constant factors from the above equation, we satisfy all our conditions. 0 Share this post Link to post Share on other sites
johnb 351 Report post Posted October 13, 2007 Perhaps the easiest way is as follows.if p = (1, 0, 0) and q = (0, 1, 0)There are two candidates for the perpendicular to these two vectors, p ^ q, and we chose p ^ q = (0, 0, 1) not (0, 0, -1) by convention.Note that this is the vx.wy of(vy.wz − wy.vz, vz.wx − wz.vx, vx.wy − wx.vy)Then if r = (0, 0, 1) you can similarly write down p ^ r, r ^ p. Reversed they are negated as the cross product is anti-symmetric. You should find they correspond to the other terms in the formula for v ^ w. The rest follows by linearity, i.e. because (a ^ b) + (a ^ c) = a ^ (b + c)and m(a ^ b) = (ma) ^ bYou can combine them to produce the full cross product. 0 Share this post Link to post Share on other sites
bitshit 163 Report post Posted October 14, 2007 Thanks guys! The penny dropped :) 0 Share this post Link to post Share on other sites