![cover image](https://wikiwandv2-19431.kxcdn.com/_next/image?url=https://upload.wikimedia.org/wikipedia/commons/thumb/7/7a/Atan2_differs_from_arctan.png/640px-Atan2_differs_from_arctan.png&w=640&q=50)
atan2
Arctangent function with two arguments / From Wikipedia, the free encyclopedia
Dear Wikiwand AI, let's keep it short by simply answering these key questions:
Can you list the top facts and stats about Atan2?
Summarize this article for a 10 year old
In computing and mathematics, the function atan2 is the 2-argument arctangent. By definition, is the angle measure (in radians, with
) between the positive
-axis and the ray from the origin to the point
in the Cartesian plane. Equivalently,
is the argument (also called phase or angle) of the complex number
![Thumb image](http://upload.wikimedia.org/wikipedia/commons/thumb/7/7a/Atan2_differs_from_arctan.png/640px-Atan2_differs_from_arctan.png)
![Thumb image](http://upload.wikimedia.org/wikipedia/commons/thumb/a/a8/Arctangent2.svg/320px-Arctangent2.svg.png)
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 (x, y) to polar coordinates (r, θ). If
and
, then
and
If x > 0, 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.[1] Using the
function does away with this correction, simplifying code and mathematical formulas.