PostgreSQL COS Function

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

PostgreSQL COS() function

COS() function

The PostgreSQL cos() function is used to return the cosine of a given argument.

Syntax :

cos(a)

PostgreSQL Version : 9.3

Pictorial presentation of PostgreSQL COS() function

 

Example PostgreSQL COS() function

SELECT COS(0) AS "Cos (0)";

Output :

 Cos (0)
---------
       1
(1 row)

Example 2: PostgreSQL COS() function

SELECT COS(1) AS "Cos (1)";

Output :

     Cos (1)
------------------
 0.54030230586814
(1 row)

Example 3: PostgreSQL COS() function

SELECT COS(-1) AS "Cos (-1)";

Output :

     Cos (-1)
------------------
 0.54030230586814
(1 row)