COS()
All functions > MATH > COS()
Returns the cosine of an angle in radians.
Signatures
Cosine
Returns: Cosine value in [-1, 1]
COS(radians: T) → DOUBLE sql
| Parameter | Type | Required | Description |
|---|---|---|---|
radians | T | Yes | Angle in radians |
With:
T: Floating-point type (FLOAT, DOUBLE)
Signature notes:
- Input must be in radians; use RADIANS() to convert from degrees
- Period of 2π; even function:
COS(-x) = COS(x) - Returns NULL if the input is NULL
Examples
FeatureQL
SELECT
f1 := COS(0E0), -- cos(0) = 1
f2 := COS(3.141592653589793E0), -- cos(π) = -1
f3 := COS(1.5707963267948966E0), -- cos(π/2) ≈ 0
f4 := COS(6.283185307179586E0) -- cos(2π) = 1
;Result
| f1 VARCHAR | f2 VARCHAR | f3 VARCHAR | f4 VARCHAR |
|---|---|---|---|
| 1.0 | -1.0 | 0.00000000000000006123233995736766 | 1.0 |
On this page