New Maix series products MaixCAM online now, and new MaixPy,feature richer functionalities, enhanced performance, and user-friendly software, with comprehensive documentationx

cmath – mathematical functions for complex numbers

This module implements a subset of the corresponding CPython module, as described below. For more information, please refer to the original CPython documentation: cmath.

The cmath module provides some basic mathematical functions for dealing with complex numbers.

1. Function#

1.1. cos#

cmath.cos(z)

Returns the cosine of z.

1.2. exp#

cmath.exp(z)

Returns the exponent of z.

1.3. log#

cmath.log(z)

Returns the natural logarithm of z. The branch cuts along the negative real axis.

1.4. log10#

cmath.log10(z)

Returns the base 10 logarithm of z. The branch cuts along the negative real axis.

1.5. phase#

cmath.phase(z)

Returns the phase, range (-pi, +pi) of the number "z".

1.6. polar#

cmath.polar(z)

Return the polar form of z as a tuple.

1.7. rect#

cmath.rect(r, phi)

Returns the complex number of the modulus r and the phase phi.

1.8. sin#

cmath.sin(z)

Returns the sine of z.

1.9. sqrt#

cmath.sqrt(z)

Returns the square root of z.

2. Constants#

2.1. cmath.e#

The basis of natural logarithm

2.2. cmath.pi#

Ratio of circumference to diameter

Related Issues not found

Please login GitHub to create issue