Arctan2 Calculator
Calculate atan2(y, x) with interactive unit circle visualization. Get results in radians, degrees, gradians, and turns instantly.
About
The two-argument arctangent function atan2(y, x) computes the angle θ between the positive x-axis and the point (x, y) in the Cartesian plane. Unlike the single-argument arctan(y ÷ x), which loses quadrant information and fails when x = 0, atan2 returns the correct angle across all four quadrants in the range (−π, π]. Getting the quadrant wrong in navigation, robotics, or game physics results in vectors pointing 180° opposite to the intended direction. This calculator uses the IEEE 754-compliant atan2 implementation and handles all edge cases including axis-aligned points and the origin.
This tool approximates nothing. It delegates to the native floating-point atan2 with full 64-bit double precision (~15 significant digits). Note: the result at the origin (0, 0) is implementation-defined by IEEE 754 and returns 0 in most environments, though mathematically the angle is undefined.
Formulas
The two-argument arctangent is defined as the angle θ from the positive x-axis to the vector (x, y):
Piecewise definition used internally:
Unit conversions from the native radian result:
Where θ is the computed angle, y is the vertical coordinate (sine component), x is the horizontal coordinate (cosine component), and π ≈ 3.14159265358979.
Reference Data
| Point (x, y) | Quadrant | atan2 (rad) | atan2 (deg) | Notes |
|---|---|---|---|---|
| (1, 0) | +x axis | 0 | 0° | Reference direction |
| (1, 1) | I | π÷4 | 45° | Diagonal, first quadrant |
| (0, 1) | +y axis | π÷2 | 90° | Straight up |
| (−1, 1) | II | 3π÷4 | 135° | Second quadrant |
| (−1, 0) | −x axis | π | 180° | Opposite of reference |
| (−1, −1) | III | −3π÷4 | −135° | Third quadrant |
| (0, −1) | −y axis | −π÷2 | −90° | Straight down |
| (1, −1) | IV | −π÷4 | −45° | Fourth quadrant |
| (0, 0) | Origin | 0 | 0° | Mathematically undefined |
| (−0, 0) | +y side | π | 180° | IEEE 754 signed zero |
| (3, 4) | I | 0.9273 | 53.13° | 3-4-5 right triangle |
| (0.5, 0.866) | I | π÷3 | 60° | Unit circle at 60° |
| (−0.707, 0.707) | II | 3π÷4 | 135° | Unit circle at 135° |
| (100, 0.001) | I | 0.00001 | 0.000573° | Nearly on +x axis |
| (0.001, 100) | I | 1.5708 | 89.999° | Nearly on +y axis |