This method returns the inverse tangent of its parameter quotient. The ATAN2 method returns the value between the angle theta of the-pi and Pi (x,y) points.
Grammar
The following are the details of the parameters:
return value:
Returns the tangent value of a number of radians
Math.atan2 (±,-0) returns±pi.
Math.atan2 (±, +0) returns±0.
Math.atan2 (±, x) returns±pi for x < 0.
Math.atan2 (±, x) returns±0 for x > 0.
Math.atan2 (y,±0) returns-pi/2 for y > 0.
Math.atan2 (±y,-infinity) returns±pi for finite y > 0.
Math.atan2 (±y, +infinity) returns±0 for finite y > 0.
Math.atan2 (±infinity, +x) Returns±pi/2 for finite x.
Math.atan2 (±infinity,-infinity) Returns±3*pi/4.
Math.atan2 (±infinity, +infinity) Returns±pi/4.
Example:
This will produce the following results:
The value:1.4056476493802698
Second test value:0.16514867741462683
Third Test value:3.1415926535897
Fourth Test value:2.356194490192345