Menu
Amazon Redshift
Database Developer Guide (API Version 2012-12-01)

ACOS Function

ACOS is a trigonometric function that returns the arc cosine of a number. The return value is in radians and is between PI/2 and -PI/2.

Syntax

Copy
ACOS(number)

Arguments

number

The input parameter is a double precision number.

Return Type

The ACOS function returns a double precision number.

Examples

The following example returns the arc cosine of -1:

Copy
select acos(-1); acos ------------------ 3.14159265358979 (1 row)

The following example converts the arc cosine of .5 to the equivalent number of degrees:

Copy
select (acos(.5) * 180/(select pi())) as degrees; degrees --------- 60 (1 row)