mirror of
https://github.com/sascha-hemi/pycom-documentation.git
synced 2026-03-21 06:06:03 +01:00
GitBook: [master] 351 pages modified
This commit is contained in:
committed by
gitbook-bot
parent
c953c89248
commit
a572e69d02
47
firmware-and-api-reference/micropython/cmath.md
Normal file
47
firmware-and-api-reference/micropython/cmath.md
Normal file
@@ -0,0 +1,47 @@
|
||||
# 5.3.6 cmath
|
||||
|
||||
The `cmath` module provides some basic mathematical functions for working with complex numbers. 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 phase `phi`.
|
||||
|
||||
### 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
|
||||
|
||||
Reference in New Issue
Block a user