The arctangent of two variables is returned through the atan2() function:
<?phpecho(atan2(0.50,0.50) . "<br>");echo(atan2(-0.50,-0.50) . "<br>");echo(atan2(5,5) . "<br>" );echo(atan2(10,20) . "<br>");echo(atan2(-5,-5) . "<br>");echo(atan2(-10,10));?>The atan2() function returns the arc tangent of two variables x and y.
atan2( y,x );
| parameter | describe |
|---|---|
| y | Required. Specifies the dividend. |
| x | Required. Specifies the divisor. |
| Return value: | The arc tangent of y/x in radians, with a value between -Pi and Pi. |
|---|---|
| Return type: | Float |
| PHP version: | 4+ |