Double-precision floating point (±1.7E±308, ~15 decimal digits)
1st Parameter
The y-coordinate of a point in a 2D Cartesian coordinate system
2nd Parameter Type : double
Double-precision floating point (±1.7E±308, ~15 decimal digits)
2nd Parameter
The x-coordinate of a point in a 2D Cartesian coordinate system
Read more about parameters of atan2 in parameters section
The atan2function in C language Calculates the arc tangent of two variables representing the quotient.
The atan2 function computes the principal value of the arc tangent of y/x, using the signs of both arguments to determine the quadrant of the return value. It is similar to calculating the arc tangent of y/x, but it has a wider range of validity and is more robust. This function returns a value in the range [-π, π].
The atan2function takes 2
parameters:
•
double `y`: The y-coordinate of a point in a 2D Cartesian coordinate system
•
double `x`: The x-coordinate of a point in a 2D Cartesian coordinate system
Computes the arc tangent (inverse tangent) of the quotient `y / x`, returning the angle in radians in the range [-π, π]. The signs of both arguments are used to determine the quadrant of the result.
The atan2 function return value :
Returns the arc tangent of y/x, in radians, in the range [-π, π]
Output
This example demonstrates the basic usage of the `atan2` function with points in all four quadrants.