Skip to main content

Categories: Math

ATAN2

Computes the Arctangent (inverse Tangent) of the ratio of its two arguments.

Syntax​

ATAN2(y NUMERIC, x NUMERIC) → DOUBLE​

  • y: Input value for the y-coordinate, in the range (negative-infinity:positive-infinity).
  • x: Input value for the x-coordinate, in the range (negative-infinity:positive-infinity).

Examples

ATAN2 example
SELECT ATAN2(1.0,0.0)
-- 1.5707963267948966
ATAN2 example
SELECT ATAN2(0.0,1.0)
-- 0.0
ATAN2 example
SELECT ATAN2(0.0,-1.0)
-- 3.141592653589793
ATAN2 example
SELECT ATAN2(-0.00000000001,-1.0)
-- -3.141592653579793
ATAN2 example
SELECT ATAN2(0.0,0.0)
-- 0.0
Return NULL for a NULL input
SELECT ATAN2(NULL, 1.0)
-- null