
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
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.)
Discovered by embedding cosine similarity (sentence-transformers MiniLM, 384-dim).