PostgreSQL ACOS Function

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

PostgreSQL ACOS() function

ACOS() function

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

Syntax :

acos(a)

PostgreSQL Version : 9.3

Pictorial presentation of PostgreSQL ACOS() function

Example 1: PostgreSQL ACOS() function

SELECT ACOS(0) AS "Acos (0)";

Output :

    Acos (0)
-----------------
 1.5707963267949
(1 row)

Example 2: PostgreSQL ACOS() function

SELECT ACOS(1) AS "Acos (1)";

Output :

 Acos (1)
----------
        0
(1 row)

Example 3: PostgreSQL ACOS() function

SELECT ACOS(-1) AS "Acos (-1)";

Output :

    Acos (-1)
------------------
 3.14159265358979
(1 row)