I highlighted the two really important parts. This is important because arc tangent limits results to quadrents I and IV.
atan - arc tangent function
double atan(double x);
The atan() function calculates the arc tangent of x; that is the value whose tangent is x.
The atan() function returns the arc tangent in radians and the value is mathematically defined to be between -PI/2 and PI/2 (inclusive).
atan2 - arc tangent function of two variables
double atan2(double y, double x);
The atan2() 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 atan2() function returns the result in radians, which is between -PI and PI (inclusive).