This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

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