Formula and Method for the Tangent Calculator
The tangent of an angle θ, written tan(θ), is defined as the ratio of the sine to the cosine of that angle: tan(θ) = sin(θ) / cos(θ). In a right triangle, this is equivalent to the ratio of the length of the side opposite the angle to the length of the side adjacent to it: tan(θ) = opposite / adjacent. This calculator takes an angle in degrees, radians, or gradians and returns its tangent along with the related sine, cosine, and cotangent values.
How the calculation works
Enter an angle and select its unit. If you choose degrees or gradians, the calculator first converts the angle to radians — radians = degrees × π/180, or radians = gradians × π/200 — because the underlying math functions expect radians. It then computes tan(θ) = sin(θ) / cos(θ) directly, along with sin(θ), cos(θ), and the cotangent cot(θ) = 1 / tan(θ) = cos(θ) / sin(θ). If cos(θ) is extremely close to zero, the tangent is undefined (it approaches +∞ or -∞), and the calculator flags this instead of returning a misleading number.
Domain, range, and periodicity
Unlike sine and cosine, which are defined for every angle and stay between -1 and 1, tangent is undefined wherever cos(θ) = 0 — at θ = 90°, 270°, and every 180° from there — because that requires dividing by zero. Where it is defined, tangent's range is all real numbers, from -∞ to +∞. Tangent also repeats every 180° (π radians), half the period of sine and cosine, so tan(θ + 180°) = tan(θ) for any θ.
Common applications
- Slope and grade: the slope of a line equals the tangent of its angle of inclination from horizontal — used for road grades, roof pitches, and ramps.
- Right-triangle problems: with one acute angle and one side known, tan(θ) = opposite / adjacent finds the missing side (surveying, construction, navigation).
- Physics and engineering: tangent appears in projectile launch angles, optics, and AC circuit phase-angle calculations.
- Surveying and mapping: elevation-angle and bearing calculations often use tangent to relate horizontal distance to height difference.