Facebook Page Twitter Page LinkedIn Page
× Python Tutorial Python Advanced Python Resources Python Libraries


The Python math.tan() function is used to return trigonometric tangent of an angle (angle should be in radians).

Syntax

math.tan(x)

Parameters

x Required. Specify the angle in radian.

Return Value

Returns the trigonometric tangent of an angle.

Example:

In the below example, tan() function is used to find out the trigonometric tangent of an angle.

import math

pi = math.pi
print(math.tan(pi/6))
print(math.tan(pi/4))
print(math.tan(pi/3))

The output of the above code will be:

0.5773502691896257
0.9999999999999999
1.7320508075688767

❮ Python Math Module