The atan2()
function returns the arc tangent of two variables x and y.
PHP atan2()
function has the following syntax.
atan2(y,x);
The parameters for PHP atan2()
function are listed below.
Parameter | Is Required | Description |
---|---|---|
y | Required. | Dividend |
x | Required. | Divisor |
Item | Value |
---|---|
Return Value | The arc tangent of y/x in radians, which is between -Pi and Pi |
Return Type | Float |
Return the arc tangent of two variables with the atan2() function:
<?php
echo(atan2(-10,10));
?>
The code above generates the following result.