Python - Methode cmath.cos()
Beispiel
Finden Sie den Kosinus einer komplexen Zahl:
#import cmath for complex number operations
import cmath
#find
the cosine of a complex number
print (cmath.cos(2 + 3j))
Definition und Verwendung
Die cmath.cos()
Methode gibt den Kosinus einer komplexen Zahl zurück.
Syntax
cmath.cos(x)
Parameterwerte
Parameter | Description |
---|---|
x | Required. A number to find the cosine of |
Technische Details
Rückgabewert: | Ein complex Wert, der den Kosinus einer komplexen Zahl darstellt |
---|---|
Python-Version: | 1.5 |