Python math.acos() Metodo
Esempio
Restituisce l'arcocoseno di numeri diversi:
# Import math Library
import math
# Return the arc cosine
of numbers
print(math.acos(0.55))
print(math.acos(-0.55))
print(math.acos(0))
print(math.acos(1))
print(math.acos(-1))
Definizione e utilizzo
Il math.acos()
metodo restituisce il valore dell'arcocoseno di un numero.
Nota: il parametro passato math.acos()
deve essere compreso tra -1 e 1.
Suggerimento: math.acos(-1)
restituirà il valore di PI.
Sintassi
math.acos(x)
Valori dei parametri
Parameter | Description |
---|---|
x | Required. A number in the range -1 to 1. If x is not a number, it returns a TypeError |
Dettagli tecnici
Valore di ritorno: | Un float valore, che rappresenta l'arcocoseno di un numero |
---|---|
Versione Python: | 1.4 |