Perpendicular vectors

Started by
3 comments, last by Mulligan 21 years, 4 months ago
Given a vector which starts at the origin and points in a direction, how can I get vectors in each direction that are perpendicular? For instance, if I had a vector v(0,0,1) pointing down the z-axis, how could I derive the vectors so that once would point strait up, down left and right? I dont know if I''m being clear, so just say so if I''m not making sence.
Advertisement
The cross product of two vectors are always perpendicular, so cross your original by suitable other vectors. Google can probably help you if you need the cross product formula.
Two vectors are perpindicular if their dot product is 0. So a vector v=(x,y,z) is perpindicular to a vector w=(a,b,c) if x*a + y*b + c*z = 0. Of course, given only 1 vector to test against, there are infinitely meny solutions.
Okay, that''s one vector, I assume the direction of the camera or something. You need to know another vector. For example, you need to know which way is up. Then to find the third, you just use a cross product. Also, if you know one vector, the vector in the opposite dirction is just the nagative of all the components.
tj963
Thanks, I had forgotten about needing a second vector, thanks for the info.

This topic is closed to new replies.

Advertisement