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
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.