atan2 function

float atan2(y, x)

y, x float The y- and x-coordinates.

Returns the principal arc tangent of y/x, in the interval [-180, 180] degrees.

The atan2 function calculates the principal value of the arc tangent of y/x, using the signs of both arguments to determine the quadrant of the return value.

Related