← All built-ins / atan2()
atan2()
atan2(mixed $number): float
Parameters
| Name | Type | Description |
|---|---|---|
| $y | float|int | y coordinate |
| $x | float|int | x coordinate |
Return value
Angle of the point (y, x) in radians — note the argument order.
Example
echo round(atan2(1, 1), 4), " ", round(atan2(0, 1), 3);
0.7854 0