Easy Tutorial
❮ Python String Index Ref Math Hypot ❯

Python math.tan() Method

Python math Module

The math.tan(x) function in Python returns the tangent of x radians.

Python Version: 1.4

Syntax

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

math.tan(x)

Parameter:

Return Value

Returns a float representing the tangent of x.

Example

The following example returns the tangent of a number:

# Import math package
import math

# Print tangent values
print(math.tan(90))
print(math.tan(-90))
print(math.tan(45))
print(math.tan(60))

Output:

-1.995200412208242
1.995200412208242
1.6197751905438615
0.3200403893795629

Python math Module

❮ Python String Index Ref Math Hypot ❯