Categories: Math
ATAN2
Computes the Arctangent (inverse Tangent) of the ratio of its two arguments.
Syntax
ATAN2(y NUMERIC, x NUMERIC) → DOUBLE
- y: Floating-point input value for the y-coordinate, in the range (negative-infinity:positive-infinity).
- x: Floating-point input value for the x-coordinate, in the range (negative-infinity:positive-infinity).
Examples
ATAN2 exampleSELECT ATAN2(1.0,0.0)
-- 1.5707963267948966
SELECT ATAN2(0.0,1.0)
-- 0.0
SELECT ATAN2(0.0,-1.0)
-- 3.141592653589793
SELECT ATAN2(-0.00000000001,-1.0)
-- -3.141592653579793
SELECT ATAN2(0.0,0.0)
-- 0.0