The cmath.atan() function calculates the arc tangent of a given complex number. The input value can be a real or complex number but the returned value will always be complex.

Syntax:
math.atan(x)
copy
x The value(real or complex) whose inverse tangent is to be calculated
Parameters:

The function returns the arc tangent of the given number ,x, in radians. The returned value is a complex number iregardless of whether the input value is real or complex. If is a real number, the returned value has 0j as its complex number.

ExampleEdit & Run
import cmath 

print(cmath.atan(-12))
print(cmath.atan(1 + 3j))
print(cmath.atan(-0.5 -2j))
copy
Output:
(-1.4876550949064553+0j) (1.4614618538579256+0.3059438579055289j) (-1.421546861001807-0.5003700000525311j) [Finished in 0.010778267867863178s]