PostgreSQL cotd() Function

The PostgreSQL cotd() function returns the cotangent of the specified number in degrees.

cotd() Syntax

This is the syntax of the PostgreSQL cotd() function:

cotd(number)

Parameters

number

Required. The number used to calculate the cotangent, in degrees.

Return value

The PostgreSQL cotd() function returns the cotangent of the specified radian.

If the parameter number is NULL, the cotd() function will return NULL.

cotd() Examples

Here are a few examples of the cotd() function:

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