Skip to content
atan2
EntityQ776598· pop 14· linked from 80 articles

thumb| returns the angle between the positive x-axis and the ray (geometry)|ray from the origin to the point , confined to . thumb|Graph of \operatorname{atan2}(y, x) over y / x

~16 min read

Encyclopedic overview

12 sections
Contents
  • Motivation
  • Argument order
  • Definition and computation
  • Derivative
  • Illustrations
  • Angle sum and difference identity
  • East-counterclockwise, north-clockwise and south-clockwise conventions, etc.
  • Realizations of the function in common computer languages
  • See also
  • References
  • External links
  • Notes

thumb| returns the angle between the positive x-axis and the ray (geometry)|ray from the origin to the point , confined to . thumb|Graph of \operatorname{atan2}(y, x) over y / x

In computing and mathematics, the function atan2 is the 2-argument arctangent. By definition, \theta = \operatorname{atan2}(y, x) is the angle measure (in radians, with -\pi ) between the positive x-axis and the ray from the origin to the point (x,\,y) in the Cartesian plane. Equivalently, \operatorname{atan2}(y, x) is the argument (also called phase or angle) of the complex number x + iy. (The argument of a function and the argument of a complex number, each mentioned above, should not be confused.)

Excerpted from Wikipedia’s “atan2” article, available under the CC BY-SA 4.0 licence.

Gallery (8)