Home >>Python math Module >Python math.tan() Method

Python math.tan() Method

Python math.tan() Method

Python math.tan() method in python is used to return the tangent of the given number in radians and it accepts a number.

Syntax:
math.tan(x)

Parameter Values

Parameter Description
x It is required a number to find the tangent.
Here is an Example of Python math.tan() Method:

import math
print (math.tan(45))
print (math.tan(-45))
print (math.tan(90))
print (math.tan(60))

Output:
1.6197751905438615
-1.6197751905438615
-1.995200412208242
0.320040389379563
Example 2:

import math
a = -5
print("tan(",a,") is = ", math.tan(a))
a = 0.6233
print("tan(",a,") is = ", math.tan(a))
a = 0
print("tan(",a,") is = ", math.tan(a))
a = 3
print("tan(",a,") is = ", math.tan(a))

Output:
tan( -5 ) is = 3.380515006246586
tan( 0.6233 ) is = 0.718902687427753
tan( 0 ) is = 0.0
tan( 3 ) is = -0.1425465430742778