Python math.cos() Metodo
Esempio
Trova il coseno di diversi numeri:
# 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))
Definizione e utilizzo
Il math.cos()
metodo restituisce il coseno di un numero.
Sintassi
math.cos(x)
Valori dei parametri
Parameter | Description |
---|---|
x | Required. A number to find the cosine of. If the value is not a number, it returns a TypeError |
Dettagli tecnici
Valore di ritorno: | Un float valore, da -1 a 1, che rappresenta il coseno di un angolo |
---|---|
Versione Python: | 1.4 |