Metoda Python math.cos()
Příklad
Najděte kosinus různých čísel:
# 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))
Definice a použití
Metoda math.cos()
vrací kosinus čísla.
Syntax
math.cos(x)
Hodnoty parametrů
Parameter | Description |
---|---|
x | Required. A number to find the cosine of. If the value is not a number, it returns a TypeError |
Technické údaje
Návratová hodnota: | Hodnota float od -1 do 1 představující kosinus úhlu |
---|---|
Verze Pythonu: | 1.4 |