Re: Help with 2d top down shooter question
Posted: Thu Aug 04, 2011 4:46 pm
Shouldn't you check if the y component is negative and add pi radians if it is?GyroVorbis wrote: The angle between the two is simply the inverse cosine of the X component of our normalized vector. That's one additional trig function.
I guess this method could also be described by just using the unit circle and not event talk about dot products, for this specific case (which i guess is not uncommon) where you want to find the angle between a vector and the x axis.