Python cmath Module

Function/MethodDescription
cmath.sqrt(x)Returns the square root of a complex number x.
cmath.exp(x)Calculates the exponential value of a complex number x.
cmath.log(x[, base])Computes the natural logarithm of a complex number x. Optionally, specify the base for a logarithm different from e.
cmath.sin(x)Calculates the sine of a complex number x.
cmath.cos(x)Calculates the cosine of a complex number x.
cmath.tan(x)Calculates the tangent of a complex number x.
cmath.asin(x)Computes the arcsine of a complex number x.
cmath.acos(x)Computes the arccosine of a complex number x.
cmath.atan(x)Computes the arctangent of a complex number x.
cmath.phase(x)Returns the phase angle of a complex number x in radians.
cmath.polar(x)Returns a tuple containing the magnitude and phase angle of a complex number x.
cmath.rect(r, phi)Constructs a complex number from its magnitude r and phase angle phi.
cmath.conj(x)Returns the complex conjugate of a complex number x.
cmath.polar(x)Returns a tuple containing the magnitude and phase angle of a complex number x.
cmath.isinf(x)Checks if a complex number x is infinite.
cmath.isnan(x)Checks if a complex number x is NaN (Not-a-Number).