# unit vector?

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

## Recommended Posts

i want my cannons in my game to recoil. im going to need the unit vector of their aim to get this. if i have their rotation (angle) how would i get a unit vector? im thinking this: tan(theta) = y / x; i could make x = 1; so tan(theta) = y which would mean the vector for that direction would be < 1, tan(theta) >.... is this a unit vector? if not, how do i find one off just an angle?

##### Share on other sites
cos(theta) = x / h
sin(theta) = y / h

Make h (the hypotenuse) 1 and you have your vector.

##### Share on other sites
oh for the love of christ.

i got an A in college calculus at virginia tech and i couldnt figure that out... wow. brain fart.

*throws away page of vector computations*

thanks.

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 16
• 11
• 9
• 25
• 53