Python math.atan2() Metodo
Esempio
Restituisce l'arcotangente di y/x in radianti:
# Import math Library
import math
# Return the arc tangent of y/x
in radians
print(math.atan2(8, 5))
print(math.atan2(20, 10))
print(math.atan2(34, -7))
Definizione e utilizzo
Il math.atan2()
metodo restituisce l'arcotangente di y/x, in radianti. Dove xey sono le coordinate di un punto (x,y).
Il valore restituito è compreso tra PI e -PI.
Sintassi
math.atan2(y, x)
Valori dei parametri
Parameter | Description |
---|---|
y | Required. Specifies a positive or negative number |
x | Required. Specifies a positive or negative number |
Dettagli tecnici
Valore di ritorno: | Un float valore, che rappresenta l'arcotangente di y/x in radianti, compreso tra PI e -PI |
---|---|
Versione Python: | 1.4 |