ACOS()
All functions > MATH > ACOS()
Returns the arccosine (inverse cosine) of a number, in radians.
Signatures
Arccosine
Returns: Angle in radians, in [0, π]
ACOS(number: T) → DOUBLE sql
| Parameter | Type | Required | Description |
|---|---|---|---|
number | T | Yes | A number in [-1, 1] |
With:
T: Floating-point type (FLOAT, DOUBLE)
Signature notes:
- Input must be in [-1, 1]
ACOS(1.0) = 0,ACOS(-1.0) = π,ACOS(0.0) = π/2- Returns NaN for inputs outside [-1, 1]
- Returns NULL if the input is NULL
Examples
FeatureQL
SELECT
f1 := ACOS(1.0E0), -- acos(1) = 0
f2 := ACOS(0.5E0), -- acos(0.5) = π/3
f3 := ACOS(0.0E0), -- acos(0) = π/2
f4 := ACOS(-1.0E0) -- acos(-1) = π
;Result
| f1 VARCHAR | f2 VARCHAR | f3 VARCHAR | f4 VARCHAR |
|---|---|---|---|
| 0.0 | 1.0471975511965976 | 1.5707963267948966 | 3.141592653589793 |
On this page