Math Functions
math.atan2()
Find the angle of a vector with components x and y, using both signs to resolve the quadrant. The y argument comes first.
Formal Syntax & Structure
python syntaxpython
math.atan2(y, x, /)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| y | real number | Vertical component of the vector. |
| x | real number | Horizontal component of the vector. |
Return Value
float
Floating-point result; finite precision and domain restrictions apply.
Working Example
Example Snippetpython
import mathprint(round(math.atan2(1, -1), 6))