PostgreSQL cotd() 函数使用指南

PostgreSQL cotd() 函数返回指定的以度为单位的数值的余切。

cotd() 语法

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

cotd(number)

参数

number
必需的。 一个用于计算余切的数值,以度为单位。

返回值

PostgreSQL cotd() 函数返回指定弧度的余切。

如果参数 number 为 NULL,cotd() 函数将会返回 NULL。

cotd() 示例

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

SELECT
    cotd(0) AS "cotd(0)",
    cotd(15) AS "cotd(15)",
    cotd(30) AS "cotd(30)",
    cotd(45) AS "cotd(45)",
    cotd(60) AS "cotd(60)",
    cotd(90) AS "cotd(90)",
    cotd(180) AS "cotd(180)";
-[ RECORD 1 ]-----------------
cotd(0)   | Infinity
cotd(15)  | 3.7320508075688767
cotd(30)  | 1.7320508075688774
cotd(45)  | 1
cotd(60)  | 0.5773502691896257
cotd(90)  | 0
cotd(180) | -Infinity