Metoda Python math.atan2().
Příklad
Vraťte arkus tangens y/x v radiánech:
# 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))
Definice a použití
Metoda math.atan2()
vrací arkus tangens y/x v radiánech. Kde x a y jsou souřadnice bodu (x, y).
Vrácená hodnota je mezi PI a -PI.
Syntax
math.atan2(y, x)
Hodnoty parametrů
Parameter | Description |
---|---|
y | Required. Specifies a positive or negative number |
x | Required. Specifies a positive or negative number |
Technické údaje
Návratová hodnota: | Hodnota float představující arkus tangens y/x v radiánech, která je mezi PI a -PI |
---|---|
Verze Pythonu: | 1.4 |