The atan function simply computes the inverse tangens of a value. The atan2 function takes two values (y and x). This function is used to convert from cartesian coordinates (x,y) to polar coordinates (r,phi), where phi=atan(y,x).
atan is the general form of inverse tangent that gets a value and returns the associated angle in radian. But atan2 gets two values of y and x and assumes a complex number as x + iy and returns its phase.