Python Math.atan2() Metoda
Przykład
Zwróć arcus tangens y/x w radianach:
# 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))
Definicja i użycie
Metoda math.atan2()
zwraca arcus tangens y/x w radianach. Gdzie x i y są współrzędnymi punktu (x,y).
Zwrócona wartość jest pomiędzy PI i -PI.
Składnia
math.atan2(y, x)
Wartości parametrów
Parameter | Description |
---|---|
y | Required. Specifies a positive or negative number |
x | Required. Specifies a positive or negative number |
Szczegóły techniczne
Wartość zwrotu: | Wartość float reprezentująca arcus tangens y/x w radianach, która znajduje się między PI a -PI |
---|---|
Wersja Pythona: | 1,4 |