ATAN2()
ATAN2(float $xCoordinate = NULL, float $yCoordinate = NULL) : float
ATAN2
This function calculates the arc tangent of the two variables x and y. It is similar to calculating the arc tangent of y ÷ x, except that the signs of both arguments are used to determine the quadrant of the result. The arctangent is the angle from the x-axis to a line containing the origin (0, 0) and a point with coordinates (xCoordinate, yCoordinate). The angle is given in radians between -pi and pi, excluding -pi.
Note that the Excel ATAN2() function accepts its arguments in the reverse order to the standard PHP atan2() function, so we need to reverse them here before calling the PHP atan() function.
Excel Function: ATAN2(xCoordinate,yCoordinate)
Parameters
float | $xCoordinate | The x-coordinate of the point. |
float | $yCoordinate | The y-coordinate of the point. |
Returns
float —The inverse tangent of the specified x- and y-coordinates.