Python Math.cos() Metoda
Przykład
Znajdź cosinus różnych liczb:
# 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))
Definicja i użycie
Metoda math.cos()
zwraca cosinus liczby.
Składnia
math.cos(x)
Wartości parametrów
Parameter | Description |
---|---|
x | Required. A number to find the cosine of. If the value is not a number, it returns a TypeError |
Szczegóły techniczne
Wartość zwrotu: | Wartość float od -1 do 1, reprezentująca cosinus kąta |
---|---|
Wersja Pythona: | 1,4 |