cos()

Learn how to use the cos() function to return the cosine of the input value.

Performs a cosine operation on the input value. The angle is specified in radians.

Syntax

cos(number)

Parameters

NameTypeRequiredDescription
numberreal✔️The value in radians for which to calculate the cosine.

Returns

The cosine of number of radians.

Examples

The following example demonstrates how to use the cos() function.

print cos(1)

Output

result
0.54030230586813977