PostgreSQL atand() 函数使用指南

PostgreSQL atand() 函数以度为单位返回指定数值的反正切。

atand() 语法

这里是 PostgreSQL atand() 函数的语法:

atand(number)

atand(number) 相当于 degrees(atan(number))

参数

number
必需的。 一个用于计算反正切的数值。

返回值

PostgreSQL atand() 函数以度为单位返回指定数值的反正切。

如果参数 numberNULLatand() 函数将会返回 NULL

atand() 示例

这里有几个 atand() 函数的示例。

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) 相当于先运算 atan(number),再将运算的结果使用 degrees() 函数转为度。比如:

SELECT
    atand(1) AS "atand(1)",
    degrees(atan(1)) AS "degrees(atan(1))";
-[ RECORD 1 ]----+---
atand(1)         | 45
degrees(atan(1)) | 45