Arctan Calculator (Inverse Tangent)

Enter a y (rise) and x (run) value to get θ = atan2(y, x) — the inverse tangent angle placed in the correct quadrant, shown in both degrees and radians along with the underlying ratio.

Quick Facts

Formula
θ = atan2(y, x), the quadrant-correct inverse tangent
Unlike plain arctan(y/x), atan2 uses the sign of both y and x to return a full -180° to 180° result instead of just -90° to 90°.
Domain
Defined for every (x, y) except (0, 0)
At the origin there is no direction to measure, so the angle is undefined only when both values are zero.

Your Results

Calculated
Angle θ (degrees)
-
atan2(y, x) in degrees
Angle θ (radians)
-
atan2(y, x) in radians
Ratio (y ÷ x)
-
tan(θ), the value arctan inverts
Quadrant
-
Position of (x, y) on the plane

Ready

Enter x and y, then press Calculate.

How the Arctan Calculator (Inverse Tangent) works

Arctan (inverse tangent, written arctan(x) or tan⁻¹(x)) answers the question: what angle has this tangent? Given a y value (rise) and an x value (run), this calculator computes θ using the two-argument arctangent, θ = atan2(y, x), which is the standard, quadrant-aware generalization of arctan used throughout mathematics, physics, and programming.

Formula and method

The plain single-argument arctan(y/x) only sees a ratio, so it cannot distinguish a point in the first quadrant from its mirror image in the third — both (3, 4) and (-3, -4) divide to the same 0.75, but they point in opposite directions. atan2(y, x) fixes this by inspecting the sign of y and x separately:

  • If x > 0: θ = arctan(y/x), giving a result between -90° and 90°.
  • If x < 0 and y ≥ 0: θ = arctan(y/x) + 180°.
  • If x < 0 and y < 0: θ = arctan(y/x) - 180°.
  • If x = 0 and y > 0: θ = 90°. If x = 0 and y < 0: θ = -90°.
  • If x = 0 and y = 0: undefined — there is no direction to measure.

The result is a full angle between -180° and 180° (-π and π radians), measured counterclockwise from the positive x-axis, matching the JavaScript Math.atan2(y, x) convention this calculator uses internally.

Common sources of error

  • Argument order: atan2 takes y first, then x — swapping them flips the result around the 45° line.
  • Confusing arctan(y/x) with atan2(y,x): when x is negative, the two differ by exactly 180°.
  • Mixing degrees and radians: this calculator shows both, but downstream formulas (like Math.sin/Math.cos in most programming languages) expect radians.

Checking your result

Recompute tan(θ) with a scientific calculator — it should match the displayed ratio y/x (except when x = 0, where the ratio is undefined but θ is still ±90°). Also check that the sign of θ matches the quadrant: positive x and y should give an angle between 0° and 90°, while negative x and positive y should land between 90° and 180°.

Applications

Arctan and atan2 show up whenever a direction or slope needs to become an angle: finding a roof pitch or ramp angle from rise and run, computing the heading between two points in navigation or robotics, finding the phase angle of a complex number or an AC circuit's impedance, and orienting graphics or game objects toward a target.

Frequently Asked Questions

What is arctan (inverse tangent)?
Arctan, written arctan(x) or tan⁻¹(x), is the inverse of the tangent function. It answers: what angle has a tangent equal to x? The single-argument arctan(x) always returns a principal value between -90° and 90° (-π/2 to π/2 radians), even though tangent itself repeats every 180°.
What is the difference between arctan(y/x) and atan2(y,x)?
arctan(y/x) only sees the ratio, so it cannot tell (3, 4) from (-3, -4) since both divide to 0.75 — it always returns an angle between -90° and 90°. atan2(y, x) looks at the sign of y and x separately, placing the angle in the correct quadrant across the full -180° to 180° range. This calculator uses atan2 for that reason.
Why is the result undefined when x and y are both 0?
At the origin (0, 0) there is no direction to measure an angle from, so atan2(0, 0) is mathematically undefined. Along either axis the function still works: atan2(1, 0) returns 90° and atan2(-1, 0) returns -90°.
How do I convert the angle between degrees and radians?
Multiply degrees by π/180 to get radians, or multiply radians by 180/π to get degrees. This calculator shows both units at once so no manual conversion is needed.