ATAN2
The angle of a direction, from its Y and X, all the way round.
Syntax
ATAN2(y,x)
| Argument | Meaning |
|---|---|
| y | The direction's Y (up). |
| x | Its X (across). |
Result
An angle in radians, from -π to π, anticlockwise from the X axis.
Examples
In the example drawing:
| Expression | Gives |
|---|---|
ATAN2(1,1) |
0.7854 |
RTOD(ATAN2(1,-1)) |
135 |
RTOD(ATAN2((P2-P0).Y,(P2-P0).X)) |
30.9638 |
Notes
Note the order: Y first. ANGLE does the same from a direction as a position.