SWiSH Player Support
SWF4 or later - Supported Internally
Syntax
Math.atan2(y,x)
Arguments
x, y: Numbers or expressions.
Returns
A number, the angle (in radians) of arc tan (y/x).
Description
Calculates the arc tan (y/x).
Handles the special cases where y = 0 or x = 0. Although x = y = 0 is undefined, function returns 0.
Sample
Math.atan2(1,1); // returns 0.785398163397448. (Pi/4 radians = 45 degrees)
Math.atan2(1,0); // returns 1.5707963267949 (Pi/2 radians = 90 degrees)
Note: Requires Advanced Math Support. See here for more information
See Also
Math.acos(), Math.acosdeg(), Math.asin(), Math.asindeg(), Math.atan(), Math.atandeg(),
Math.cos(), Math.cosdeg(), Math.sin(), Math.sindeg(), Math.tan(), Math.tandeg(),
Math.atan2(y,x) and Math.atan2deg(y,x).