The function first appeared in the programming language Fortran in 1961. It was originally intended to return a correct and unambiguous value for the angle in converting from Cartesian coordinates to polar coordinates. If and , then and
If , the desired angle measure is However, when x < 0, the angle is diametrically opposite the desired angle, and (a half turn) must be added to place the point in the correct quadrant. Using the function does away with this correction, simplifying code and mathematical formulas.