Function in C (and also in C++, Perl, Lisp, Python, ...) which computes the angle of the vector (x,y) with the x axis. To convert (x,y) to polar coordinates, you say

r = √(x2+y2)
θ = atan2(y,x)

atan2(y,x) ≠ atan(y/x) (!!)

To see why, it is sufficient to consider the cases x=y=1 and x=y=-1. In both cases, y/x=1, and atan(1)=π/4. But considering the direction we need to go from the x axis to get to (1,1) or to (-1,-1), we see that atan2(1,1)=π/4, while atan2(-1,-1)=5π/4 points in exactly the opposite direction.

Besides, when x=0 you really don't want to be dividing by x. And when |x| is very small compared to |y|, computing first y/x and then taking the arctangent is very inaccurate.

Indeed, the range of atan is [-π/2,π/2], whereas that of atan2 is [-π,π].

All these unpleasantries associated with the use of atan(x) conspire to make atan2(y,x) the more useful function, despite the fact you don't learn it in high school...