PostgreSQL atand() Function
The PostgreSQL atand()
function returns the arctangent of a specified number in degrees.
atand()
Syntax
This is the syntax of the PostgreSQL atand()
function:
atand(number)
atand(number)
Equivalent to degrees(atan(number))
.
Parameters
number
-
Required. The number used to calculate the arctangent.
Return value
The PostgreSQL atand()
function returns the arctangent of a specified number in degrees.
If the parameter number
is NULL
, the atand()
function will return NULL
.
atand()
Examples
Here are a few examples of the atand()
function:
SELECT
atand(-1) AS "atand(-1)",
atand(-0.5) AS "atand(-0.5)",
atand(-0.2) AS "atand(-0.2)",
atand(0) AS "atand(0)",
atand(0.2) AS "atand(0.2)",
atand(0.5) AS "atand(0.5)",
atand(1) AS "atand(1)";
-[ RECORD 1 ]--------------------
atand(-1) | -45
atand(-0.5) | -26.565051177077986
atand(-0.2) | -11.309932474020215
atand(0) | 0
atand(0.2) | 11.309932474020215
atand(0.5) | 26.565051177077986
atand(1) | 45
atand(number)
is equivalent to perform atan(number)
first, and then converting the result to degrees using degrees()
function, for example:
SELECT
atand(1) AS "atand(1)",
degrees(atan(1)) AS "degrees(atan(1))";
-[ RECORD 1 ]----+---
atand(1) | 45
degrees(atan(1)) | 45