COS
The cosine of an angle in radians.
Group: Math. Compatible with DAX.
Syntax
COS ( <number> )
| Parameter | Type | Description |
|---|---|---|
number | Number | An angle in radians. |
Returns
Number. A number from -1 to 1: 1 for an angle of 0, -1 for half a turn.
Remarks
- Angles are in radians. To work in degrees, wrap the angle in
RADIANSfirst. - A blank counts as an angle of 0, so its cosine is 1.
- Floating point leaves a trace:
COS ( PI () / 2 )is a tiny number rather than exactly 0. - Very large angles, such as 1E9 radians, are an error.
Examples
Cosines
EVALUATE
ROW (
"Of 0", COS ( 0 ),
"Of pi", COS ( PI () ),
"Of 60°", COS ( RADIANS ( 60 ) ),
"Of blank", COS ( BLANK () )
)
| Of 0 | Of pi | Of 60° | Of blank |
|---|---|---|---|
| 1 | -1 | 0.5 | 1 |