find a vector perpendicular to vector

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

Recommended Posts

If i have a vector how do i find another vector that is perpendicular to it?

Share on other sites
Very simple mathamatics here, all you need to is find the slope of the vector (& the midpoint if you are talking about line segments), then multiply the slope by -1.

2D or 3D?

Share on other sites
this is only possible in 2 dimensions, in which case its a simple matter of rotating the vector 90 deg, which can be done like this:

output.x = -input.y;
output.y = input.x;

Share on other sites
Quote:
 Original post by Eelcothis is only possible in 2 dimensions

It is certainly possible in 3D, only the solution will be any vector lying in a plane perpendicular to the original vector.

Share on other sites
say your vector is v(x, y, z)
easy take and arbitrary vector say r(y, z, x)

the the cross product will generate a vector perpedicular to both

p = cross (v, r)

further more anorther cross product and to get the basis for cordenate system

t = cross (v * p)

know you have not one but two vectors perpendicular to the first,

Share on other sites
Given (x,y,z) then (-(y*y+z*z)/x,y,z), (x,-(x*x+z*z)/y,z) and (x,y,-(x*x+y*y)/z) are all orthogonal (perpendicular) to it assuming x, y nor z are zero. If (x,y,z)=(0,0,0) then any vector is orthogonal to it. If (x,y,z)!=(0,0,0) then at least one component is not zero so one of the three vectors will work.

Share on other sites
Quote:
Original post by Anonymous Poster
Quote:
 Original post by Eelcothis is only possible in 2 dimensions

It is certainly possible in 3D, only the solution will be any vector lying in a plane perpendicular to the original vector.

so the solution to the 3d version of the problem is a plane, not a vector. no unique solution might aswell be no solution at all for all practical intents and purposes.

Share on other sites
Quote:
 Original post by Anonymous Postersay your vector is v(x, y, z)easy take and arbitrary vector say r(y, z, x)the the cross product will generate a vector perpedicular to both...

So do not choose r == v by accident, since the result will be vector (0/0/0).

Share on other sites
Quote:
 Original post by Eelcoso the solution to the 3d version of the problem is a plane, not a vector. no unique solution might aswell be no solution at all for all practical intents and purposes.

Wrong, since the question was simply to find a vector perpendicular to the first, not to find the ONLY vector perpendicular to the first. There can very well be a practical purpose to finding such a vector. (Btw, the 2D case does not give a unique solution either, even though they all lie along the same line.)

• 13
• 18
• 29
• 11
• 28