← All built-ins / atan2()

atan2()

atan2(mixed $number): float

Parameters

NameTypeDescription
$yfloat|inty coordinate
$xfloat|intx 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

See also

atan()