#import the cmath module
import cmath
# print the tangent of a radian angle
print(cmath.tan(0.5236 + 0j))
cmath.tan()
function is used to calculate the tangent of a complex angle given in radians. The angle should be in radians not in degrees.
cmath.tan(x)
x |
The radian complex angle whose tangent we want. The value can be a real or a complex number. If it is a real number, it is first converted to a complex value before the operation. |
The function returns the tangent of the input argument, x
.
import cmath
print(cmath.tan(0))
print(cmath.tan(0.15))
print(cmath.tan(1 + 2j))
print(cmath.tan(0.1 + 0.2j))