Formula and Method for the Tan Inverse Calculator
The inverse tangent, written tan⁻¹(x) or arctan(x), is the angle θ whose tangent equals x. If tan(θ) = x, then θ = tan⁻¹(x). Since tan(θ) = opposite / adjacent in a right triangle, tan⁻¹(x) answers the question "what angle produces this ratio of opposite to adjacent side?" This calculator takes any real number x — positive, negative, zero, or very large — and returns the principal angle θ in degrees, radians, and gradians, plus a check that recomputes tan(θ) so you can confirm it matches your input.
How the calculation works
Enter x, the ratio you want the angle for. The calculator computes θ = tan⁻¹(x) in radians using the arctangent function, then converts that radian value to degrees (θ° = θ_rad × 180/π) and gradians (θ_grad = θ_rad × 200/π). Because tangent repeats every 180°, tan⁻¹ always returns its principal value, strictly between -90° and 90° (-π/2 and π/2 radians) — it never returns 90° or -90° exactly, since tan(θ) is undefined at those points. The tool also shows tan(θ) recomputed from the result, which should match your original x (subject to rounding) as a sanity check.
arctan(x) vs. atan2(y, x)
tan⁻¹(x) only sees the ratio, so it cannot tell whether the original opposite and adjacent sides were both positive or both negative — 1/1 and (-1)/(-1) both give x = 1 and the same 45° answer, even though those correspond to different quadrants. If you need the full angle for a coordinate pair (x, y), including which quadrant it lies in across the whole -180° to 180° range, use the two-argument function atan2(y, x) instead, which examines the sign of each side separately.
Common applications
- Finding an unknown angle in a right triangle when the opposite and adjacent side lengths (or their ratio) are known.
- Computing the angle of a slope, ramp, or roof pitch from its rise-over-run ratio.
- Determining the direction of a 2D vector or line segment in physics, engineering, and computer graphics.
- Evaluating derivatives and integrals involving tan⁻¹(x) in calculus, where d/dx[tan⁻¹(x)] = 1/(1 + x²).