2.1.912 Part 4 Section 220.127.116.11, ATAN2
a. The standard states that the return value of the function is the arc tangent of x.
In Office, the return value of the function is the arc tangent of two arguments determined by the point (x, y); that is, the angle in the Cartesian plane formed by the positive x-axis and the vector from (0,0) to the point (x, y); the result is constrained to be in the half-open interval (-π,π]. This function is useful in converting from rectangular coordinates (x, y) to polar coordinates (r,θ), with the angle θ being returned by this function, in radians.
If x> 0 (in the 1st or 4th quadrant or on the positive x -axis), then ATAN2(x,y) =arctan(y/x);
If x< 0 and y≥ 0 (in the 2nd quadrant or on the negative x -axis), then ATAN2(x,y) =arctan(y/x) + π;
If x< 0 and y< 0 (in the 3rd quadrant), then ATAN2(x,y) =arctan(y/x) - π;
If x = 0 and y≠ 0 (on the y -axis excluding the origin), then ATAN2(x,y) =(π/2)*sgn(y),
In the preceding formulas, arctan is the principal value of inverse tangent function, whose range is the interval (-π/2,π/2), and sgn(y) returns one of the values -1, 0, or +1 according as y is negative, zero, or positive.