Rotate a unit vector 90degrees

Started by
3 comments, last by smittix 18 years, 8 months ago
I have been working at this for a while and I cannot seem to figure it out, although it seems to be so simple. Lets say I have any given unit vector, lets say (0, 0, -1), how would I find the unit vector 90degrees to the right of it? I thought that switching the Z and X coordiantes would work but it most definitely does not. -Chris
Advertisement
In three dimensions there are an infinite number of vectors at 90 degress to a unit vector. You'll need to supply more information on the orientation of the new vector.
Sorry about that, the vector is a 3D vector, but the Y value will always be 0, so it is actually a 2D problem. So I guess the question is how to rotate a 2D vector 90degrees to the right, given any arbitrary vector.
Swap x and z and negate one of them. In your case, I'm guessing you want (z,0,-x).
Like a charm, thanks.

-Chris

This topic is closed to new replies.

Advertisement