ATAN2

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

Syntax

``````ATAN2 ( y, x )
``````

Results

`ATAN2` returns the arc tangent of y/x in the range -pi to pi radians, as a  ```DOUBLE PRECISION``` number.

• 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 topi/2.
• If the first argument is negative and the second argument is zero, the result is the double value closest to -pi/2.

Example

``````splice> VALUES ATAN2(1, 0);
1
----------
1.5707963267948966

1 row selected
``````