PostgreSQL cot() Function

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

cot() Syntax

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

cot(number)

Parameters

number

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

Return value

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

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

cot() Examples

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

SELECT
    cot(2.5) AS "cot(2.5)",
    cot(0.2) AS "cot(0.2)",
    cot(-0.5) AS "cot(-0.5)",
    cot(-0.2) AS "cot(-0.2)",
    cot(0) AS "cot(0)",
    cot(pi()) AS "cot(pi())";
cot(2.5)  | -1.3386481283041516
cot(0.2)  | 4.933154875586893
cot(-0.5) | -1.830487721712452
cot(-0.2) | -4.933154875586893
cot(0)    | Infinity
cot(pi()) | -8.165619676597685e+15

Here, we use the pi() function to obtain an approximation of pi.