Methode Python math.cos()
Voorbeeld
Vind de cosinus van verschillende getallen:
# 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))
Definitie en gebruik
De math.cos()
methode retourneert de cosinus van een getal.
Syntaxis
math.cos(x)
Parameterwaarden
Parameter | Description |
---|---|
x | Required. A number to find the cosine of. If the value is not a number, it returns a TypeError |
Technische details
Winstwaarde: | Een float waarde, van -1 tot 1, die de cosinus van een hoek voorstelt |
---|---|
Python-versie: | 1.4 |