SQL Language Reference / Functions |

The ATAN2 function returns the arctangent, in radians, of the quotient of the two arguments.

Upon successful completion, the function returns the arc tangent of
*y*/*x* in the range -*pi* to
*pi* radians, where
*y* is the first argument and
*x* is the second argument. The specified numbers must be
DOUBLE PRECISION numbers.

- If either argument is NULL, the result of the function is NULL.
- If the first argument is zero and the second argument is positive, the result of the function is zero.
- If the first argument is
zero and the second argument is negative, the result of the function is the
double value closest to
*pi*. - If the first argument is
positive and the second argument is zero, the result is the double value
closest to
*pi*/2. - If the first argument is
negative and the second argument is zero, the result is the double value
closest to -
*pi*/2.

The data type of the returned value is a DOUBLE PRECISION number.

ATAN2 (y,x)