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.

1. Functions

1.1. cos


Return the cosine of z.

1.2. exp


Return the exponential of z.

1.3. log


Return the natural logarithm of z. The branch cut is along the negative real axis.

1.4. log10


Return the base-10 logarithm of z. The branch cut is along the negative real axis.

1.5. phase


Returns the phase of the number z, in the range (-pi, +pi].

1.6. polar


Returns, as a tuple, the polar form of z.

1.7. rect

cmath.rect(r, phi)

Returns the complex number with modulus r and phase phi.

1.8. sin


Return the sine of z.

1.9. sqrt


Return the square-root of z.

2. Constants

2.1. cmath.e

base of the natural logarithm

2.2. cmath.pi

the ratio of a circle’s circumference to its diameter

powered by GitbookFile Modify: 2021-02-03 10:26:57

results matching ""

    No results matching ""