COS
All functions > MATH > COS
Returns the cosine of an angle in radians.
Syntax
COS(radians: T) → DOUBLE sql
Type Parameters:
T: Any numeric type (TINYINT, SMALLINT, INTEGER, BIGINT, FLOAT, DOUBLE, DECIMAL)
Arguments
| Parameter | Type | Required | Description |
|---|---|---|---|
radians | T | Yes | Angle in radians (DOUBLE) |
Returns
DOUBLE - Cosine value (between -1 and 1)
Notes
- Input angle must be in radians (use RADIANS() to convert from degrees)
- Returns values in the range [-1, 1]
COS(0) = 1,COS(π/2) = 0,COS(π) = -1- Period of 2π:
COS(x) = COS(x + 2π) - Even function:
COS(-x) = COS(x) - Returns NULL if input is NULL