Méthode Python math.atan2()
Exemple
Renvoie l'arc tangente de y/x en radians :
# 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))
Définition et utilisation
La math.atan2()
méthode renvoie l'arc tangente de y/x, en radians. Où x et y sont les coordonnées d'un point (x,y).
La valeur renvoyée est comprise entre PI et -PI.
Syntaxe
math.atan2(y, x)
Valeurs des paramètres
Parameter | Description |
---|---|
y | Required. Specifies a positive or negative number |
x | Required. Specifies a positive or negative number |
Détails techniques
Valeur de retour : | Une float valeur, représentant l'arc tangente de y/x en radians, comprise entre PI et -PI |
---|---|
Version Python : | 1.4 |