Cloud

atan2d

The atan2d() function returns the inverse tangent (arctangent) of y divided by x, expressed in degrees. Unlike atand(), atan2d() uses the signs of both arguments to determine the correct quadrant of the result. See also atan2() to return the result in radians.

Syntax

ATAN2D(y, x)

Arguments

  • y: A number of type real or double precision.

  • x: A number of type real or double precision, of the same type as y.

Return type

Same as the input type (real or double precision).

Examples

Basic usage

SELECT ATAN2D(1, 0);
 atan2d
--------
     90
(1 row)

Negative y value

SELECT ATAN2D(-1, 0);
 atan2d
--------
    -90
(1 row)