PHP atan2() Function
Example
Return the arc tangent of two variables via atan2():
"); echo(atan2(-0.50,-0.50) . ""); echo(atan2(5,5) . "
"); echo(atan2(10,20) . "
"); echo(atan2(-5,-5) . "
"); echo(atan2(-10,10)); ?>
Run Example »
Definition and Usage
The atan2() function returns the arc tangent of two variables x and y.
Syntax
atan2(
y,x
);
| Parameters | Description |
|---|---|
| y | Required. Specifies the dividend. |
| x | Required. Specifies the divisor. |
Technical Details
| Return Value: | The arc tangent of y/x, in radians, with a value between -Pi and Pi. |
|---|---|
| Return Type: | Float |
| PHP Version: | 4+ |
PHP Math Reference Manual