ACOS
All functions > MATH > ACOS
Returns the arccosine (inverse cosine) of a number in radians.
Signatures
Returns: Arccosine in radians (between 0 and π)
ACOS(number: T) → DOUBLE sql
| Parameter | Type | Required | Description |
|---|---|---|---|
number | T | Yes | A number between -1 and 1 (inclusive) |
Notes
- Input must be in the range [-1, 1]
- Returns values in the range [0, π] radians
ACOS(1) = 0,ACOS(-1) = π,ACOS(0) = π/2- Returns NULL if input is NULL
- Returns NaN for inputs outside [-1, 1]
- Inverse of COS function:
ACOS(COS(x)) = xfor x in [0, π]
Examples
FeatureQL
SELECT
f1 := ACOS(1.0e0), -- Arccosine of 1
f2 := ACOS(0.5e0), -- Arccosine of 0.5 (60 degrees)
f3 := ACOS(0.0e0), -- Arccosine of 0 (90 degrees)
f4 := ACOS(-1.0e0) -- Arccosine of -1 (180 degrees)
;Result
| f1 VARCHAR | f2 VARCHAR | f3 VARCHAR | f4 VARCHAR |
|---|---|---|---|
| 0.0 | 1.0471975511965976 | 1.5707963267948966 | 3.141592653589793 |
On this page