atan2
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
#include <math.h> double atan2 ( double y, double x);
The atan2 function returns the arc tangent of y/x, in the range (-pi,pi). When the arguments are outside the permissible range, errno is set and matherr is called.
A domain error occurs if both arguments are zero.
#include <math.h> #include <stdio.h> main () { printf ("%f\n", atan2 (.5, 1.) ); }
produces the following:
0.463648