Sign in to follow this  
xSKOTTIEx

unit vector?

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 this post


Link to post
Share on other sites
Guest Anonymous Poster
cos(theta) = x / h
sin(theta) = y / h

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this