Python cmath.cos() Metode
Voorbeeld
Vind die cosinus van 'n komplekse getal:
#import cmath for complex number operations
import cmath
#find
the cosine of a complex number
print (cmath.cos(2 + 3j))
Definisie en gebruik
Die cmath.cos()
metode gee die cosinus van 'n komplekse getal terug.
Sintaksis
cmath.cos(x)
Parameterwaardes
Parameter | Description |
---|---|
x | Required. A number to find the cosine of |
Tegniese besonderhede
Terugkeerwaarde: | 'n complex Waarde wat cosinus van 'n komplekse getal voorstel |
---|---|
Python weergawe: | 1.5 |