💾 Archived View for tris.fyi › pydoc › cmath captured on 2023-04-26 at 13:34:41. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2022-01-08)

-=-=-=-=-=-=-

Back to module index

Go to module by name

cmath

This module provides access to mathematical functions for complex
numbers.

Functions

acos

acos(z, /)

  Return the arc cosine of z.

acosh

acosh(z, /)

  Return the inverse hyperbolic cosine of z.

asin

asin(z, /)

  Return the arc sine of z.

asinh

asinh(z, /)

  Return the inverse hyperbolic sine of z.

atan

atan(z, /)

  Return the arc tangent of z.

atanh

atanh(z, /)

  Return the inverse hyperbolic tangent of z.

cos

cos(z, /)

  Return the cosine of z.

cosh

cosh(z, /)

  Return the hyperbolic cosine of z.

exp

exp(z, /)

  Return the exponential value e**z.

isclose

isclose(a, b, *, rel_tol=1e-09, abs_tol=0.0)

  Determine whether two complex numbers are close in value.

    rel_tol
      maximum difference for being considered "close", relative to the
      magnitude of the input values
    abs_tol
      maximum difference for being considered "close", regardless of the
      magnitude of the input values

  Return True if a is close in value to b, and False otherwise.

  For the values to be considered close, the difference between them must be
  smaller than at least one of the tolerances.

  -inf, inf and NaN behave similarly to the IEEE 754 Standard. That is, NaN is
  not close to anything, even itself. inf and -inf are only close to themselves.

isfinite

isfinite(z, /)

  Return True if both the real and imaginary parts of z are finite, else False.

isinf

isinf(z, /)

  Checks if the real or imaginary part of z is infinite.

isnan

isnan(z, /)

  Checks if the real or imaginary part of z not a number (NaN).

log

log(...)

  log(z[, base]) -> the logarithm of z to the given base.

  If the base not specified, returns the natural logarithm (base e) of z.

log10

log10(z, /)

  Return the base-10 logarithm of z.

phase

phase(z, /)

  Return argument, also known as the phase angle, of a complex.

polar

polar(z, /)

  Convert a complex from rectangular coordinates to polar coordinates.

  r is the distance from 0 and phi the phase angle.

rect

rect(r, phi, /)

  Convert from polar coordinates to rectangular coordinates.

sin

sin(z, /)

  Return the sine of z.

sinh

sinh(z, /)

  Return the hyperbolic sine of z.

sqrt

sqrt(z, /)

  Return the square root of z.

tan

tan(z, /)

  Return the tangent of z.

tanh

tanh(z, /)

  Return the hyperbolic tangent of z.

Other members

e = 2.718281828459045
inf = inf
infj = infj
nan = nan
nanj = nanj
pi = 3.141592653589793
tau = 6.283185307179586