• Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

We're also offering banner ads on our site from just \$5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.

Posted 18 April 2013 - 02:37 PM

The arguments for atan2 are the y and x coordinates of the triangle, angle = atan2(y, x). y = opposite, x = adjacent in trig-speak, remember that tan(theta) = opposite/adjacent.

EDIT: 0 radians is facing due east, pi/2 is north, pi (or -pi) is west and -pi/2 is south.

Posted 18 April 2013 - 02:35 PM

The arguments for atan2 are the y and x coordinates of the triangle, angle = atan2(y, x). y = opposite, x = adjacent in trig-speak, remember that tan(theta) = opposite/adjacent.

Posted 18 April 2013 - 02:35 PM

The arguments for atan2 are the y and x coordinates of the triangle, angle = atan2(y, x). y = opposite, x = adjacent, in trig-speak, remember that tan(theta) = opposite/adjacent.