Python math.cos()- Methode
Beispiel
Finden Sie den Kosinus verschiedener Zahlen:
# Import math Library
import math
# Return the cosine of
different numbers
print (math.cos(0.00))
print (math.cos(-1.23))
print (math.cos(10))
print (math.cos(3.14159265359))
Definition und Verwendung
Die math.cos()
Methode gibt den Kosinus einer Zahl zurück.
Syntax
math.cos(x)
Parameterwerte
Parameter | Description |
---|---|
x | Required. A number to find the cosine of. If the value is not a number, it returns a TypeError |
Technische Details
Rückgabewert: | Ein float Wert zwischen -1 und 1, der den Kosinus eines Winkels darstellt |
---|---|
Python-Version: | 1.4 |