Python math.tan() Method
Python math.tan(x) Returns the tangent of x radians.
Python version: 1.4
Syntax
The syntax of the math.tan() method is as follows:
math.tan(x)
Parameter Description:
- x -- required, a number. If x is not a number, a TypeError is returned.
Return Value
Returns a floating-point number representing the tangent of x.
Example
The following example returns the tangent of numbers:
Example
Import the math package
import
math
Output the tangent values
(
math
.
tan
(
90
)
)
(
math
.
tan
(
90
)
)
(
math
.
tan
(
45
)
)
(
math
.
tan
(
60
)
)
Output result:
-1.995200412208242
1.995200412208242
1.6197751905438615
0.3200403893795629
Python math Module