Easy Tutorial
❮ Python File Next Ref Set Symmetric_Difference ❯

Python math.cos() Method

Python math Module

Python math.cos(x) returns the cosine of x radians.

Python Version: 1.4

Syntax

The syntax for the math.cos() method is as follows:

math.cos(x)

Parameter:

Return Value

Returns a floating-point number representing the cosine of x, between -1 and 1.

Example

The following example returns the cosine of a number:

# Import math package
import math

# Print cosine values
print(math.cos(0.00))
print(math.cos(-1.23))
print(math.cos(10))
print(math.cos(3.14159265359))

Output:

1.0
0.3342377271245026
-0.8390715290764524
-1.0

Python math Module

❮ Python File Next Ref Set Symmetric_Difference ❯