atan2 is based on the arctangent function, but it expects two arguments to correctly determine the resulting quadrant.
Atan2 calculation algorithm
Arctan2 with all positive x is same as ordinal arc tangent:
For other x values, arctan2 can be calculated according the following table:
|y<0||y = 0||y>0|