The Python cmath module provides access to the complex mathematical functions. The functions within this module accepts integers, floating points or complex numbers as arguments and converts them into a complex or floating point numbers.
A Python Polar coordinates, gives an alternative way to represent a complex number z. Where, z is stored internally using Cartesian coordinates. This is completely determined by its real part and its imaginary part.
Importing cmath ModuleBefore using any function of the cmath module, we need to import it by using the following command −
import cmathPower and Logarithmic Functions in cmath Module
Python includes following power and logarithmic functions in cmath module −
S.No Function & Description 1This function returns e raised to the power x, where e is the base of natural logarithms.
2This function returns the logarithm of x to the given base.If base is not specified,returns the natural logarithm of x.
3This function returns the base-10 logarithm of x . This has the same branch cut as log().
4This function returns the square root of x. This has the same branch cut as log().
Trigonometric Functions in cmath ModulePython includes following functions that perform trigonometric calculations in the cmath module −
S.No Function & Description 1This function returns the arc cosine of x .Where in this function values extent from (1,) or (-1,-).
2This function returns the arc sine of x. This is similar to acos().
3This function rReturns the tangent of x .Where in this function values extent from (1j,j) or (-1,-j).
4This function returns the inverse hyperbolic cosine of the given value.
5This function returns the inverse hyperbolic sine of given number.
6This function returns the inverse hyperbolic tangent of a number.
7This function returns the hyperbolic cosine of x.
8This function returns the hyperbolic sine of x.
9This function returns the hyperbolic tangent of x.
Classification FunctionsPython includes following theoretic representation function in the cmath module −
S.No Function & Description 1This function returns True if both the real and imaginary parts of x are finite; otherwise return False.
2This function returns True if either the real or the imaginary part of x i an infinity; otherwise False.
3This function returns True if both the real or the imaginary part of x is a NaN; otherwise False.
4This function returns True if the values a and b are close to each other otherwise False.
ConstantsThe Python cmath module defines the following mathematical constant −
S.No Function & Description 1The mathematical constant , as a float.
2The mathematical constant e,as a float.
3Floating point positive infinity. Equivalent to float.
4Floating point is not a number(NaN) value. This is Equivalent to float('nan').
5This function returns the complex number with zero real part and NaN imaginary part. Equivalent to complex (0.0, float('nan')).
6The mathematical constant , as a float.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4