cmath
β mathematical functions for complex numbersΒΆ
This module implements a subset of the corresponding CPython module,
as described below. For more information, refer to the original
CPython documentation: cmath
.
The cmath
module provides some basic mathematical functions for
working with complex numbers.
Availability: not available on WiPy and ESP8266. Floating point support required for this module.
FunctionsΒΆ
- cmath.cos(z)ΒΆ
Return the cosine of
z
.
- cmath.exp(z)ΒΆ
Return the exponential of
z
.
- cmath.log(z)ΒΆ
Return the natural logarithm of
z
. The branch cut is along the negative real axis.
- cmath.log10(z)ΒΆ
Return the base-10 logarithm of
z
. The branch cut is along the negative real axis.
- cmath.phase(z)ΒΆ
Returns the phase of the number
z
, in the range (-pi, +pi].
- cmath.polar(z)ΒΆ
Returns, as a tuple, the polar form of
z
.
- cmath.rect(r, phi)ΒΆ
Returns the complex number with modulus
r
and phasephi
.
- cmath.sin(z)ΒΆ
Return the sine of
z
.
- cmath.sqrt(z)ΒΆ
Return the square-root of
z
.
ConstantsΒΆ
- cmath.eΒΆ
base of the natural logarithm
- cmath.piΒΆ
the ratio of a circleβs circumference to its diameter