atan2
Summary
Returns the angle (in radians) from the X axis to a point ( y , x ).
Syntax
Math.atan2( y , x )
- x
- Required. A numeric expression representing the cartesian x-coordinate.
- y
- Required. A numeric expression representing the cartesian y-coordinate.
Examples
var v1 = Math.atan2(2,3);
document.write(v1);
// Output: 0.5880026035475675
Remarks
The return value is between -pi and pi. It represents the angle of the supplied ( y , x ) point, in radians.
Applies To : Math Object
See also
Other articles
Attributions
Microsoft Developer Network: Article