# Rotate a unit vector 90degrees

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

## Recommended Posts

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

##### Share on other sites
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.

##### Share on other sites
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.

##### Share on other sites
Swap x and z and negate one of them. In your case, I'm guessing you want (z,0,-x).

##### Share on other sites
Like a charm, thanks.

-Chris

1. 1
2. 2
Rutin
13
3. 3
4. 4
5. 5

• 9
• 9
• 14
• 12
• 10
• ### Forum Statistics

• Total Topics
633260
• Total Posts
3011125
• ### Who's Online (See full list)

There are no registered users currently online

×