Skip to main content
Version: current [25.x]

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 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