#include <math.h>
double atan2(double y, double x);
atan2 returns the value, in radians, of the inverse circular tangent of y divided by x using the signs of x and y to compute the quadrant of the return value. The principal value lies in the interval [-PI/2, +PI/2] radians.
If x = y = 0, errno is set to EDOM and atan2 returns HUGE_VAL.
atan2f(x, NaN) is NaN
atan2f(NaN, x) is NaN
atan2f(±0, +(anything but NaN)) is ±0
atan2f(±0, -(anything but NaN)) is ±π
atan2f(±(anything but 0 and NaN), 0) is ±π/2
atan2f(±(anything but ∞ and NaN), +∞) is
±0
atan2f(±(anything but ∞ and NaN), -∞) is
±π
atan2f(±∞, +∞) is ±π/4
atan2f(±∞, -∞) is ±3π/4
atan2f(±∞, (anything but 0, NaN, and ∞))
is ±π/2
atan2 conforms to ISO/IEC 9899:1990 (C90) and ISO/IEC 9899:1999 (C99).