May 2011
Intermediate to advanced
1096 pages
40h 54m
English
Math.atan2() — compute the angle from the X axis to a point
Math.atan2(y,x)
yThe Y coordinate of the point.
xThe X coordinate of the point.
A value between -π and π radians that specifies the
counterclockwise angle between the positive X axis and the point
(x,
y).
The Math.atan2() function
computes the arc tangent of the ratio
y/x. The
y argument can be considered the Y
coordinate (or “rise”) of a point, and the
x argument can be considered the X
coordinate (or “run”) of the point. Note the unusual order of the
arguments to this function: the Y coordinate is passed before the X
coordinate.
Read now
Unlock full access