PostgreSQL cosd() Function

The PostgreSQL cosd() function returns the cosine of the specified number in degrees.

cosd() Syntax

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

cosd(number)

Parameters

number

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

Return value

The PostgreSQL cosd() function returns the cosine of the specified radian.

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

cosd() Examples

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

SELECT
    cosd(0) AS "cosd(0)",
    cosd(15) AS "cosd(15)",
    cosd(30) AS "cosd(30)",
    cosd(60) AS "cosd(60)",
    cosd(90) AS "cosd(90)",
    cosd(180) AS "cosd(180)";
-[ RECORD 1 ]-----------------
cosd(0)   | 1
cosd(15)  | 0.9659258262890683
cosd(30)  | 0.8660254037844387
cosd(60)  | 0.5
cosd(90)  | 0
cosd(180) | -1