Tan Calculator
Calculate tan(θ) = sin(θ)/cos(θ) in degrees or radians. Fast local calculation with shareable, machine-readable results.
Enter values to calculate.
Live graph
Interactive plot
Trust summary CVP VERIFIED · CVP protocol 1.0.0-proposed · Core assurance
- Input interpretation
- Enter values to calculate.
- Result
- —
- Assurance
- Core
- Declared partition coverage
- PASS · 3/3 declared partitions (tan, invalid-domain, xcal) · Matrix
- Numerical scope
- ≤2 ULP vs O3 applies to the 16 published tabulated vectors (common angles away from poles plus 8 seeded random angles in (−50°, 50°)). It is not a guarantee over the entire real line, including poles, huge angles, or unlisted neighborhoods of zeros.
- Known limitations
- deg|rad; pole classification / snap / |y| cleanup are documented numerical policies
- Core CVP does not include live graph, viewport, or pointer interaction.
- Model
- The real tangent y = tan(θ) = sin(θ)/cos(θ) when defined. Default unit is degrees.
- Scope
- Real tangent only. Inverse is Arctan, not this published engine.
- Verification
- Engine tested · Source checked · v1.0.4 · CVP VERIFIED · CVP protocol 1.0.0-proposed · Core assurance· View Manifest · CVP overview · Specification
- Versions
- Calculation 1.0.4 · CVP protocol 1.0.0-proposed · Evidence 2026-09-08.policy
- Verification revision
- 2026-09-08.policy · 5/5 property · digest 494caf2c4f61
- Legacy regression
- 25/25 tests · Production surface contract 3/3
- Reference
- O1 model · O3 expected_values · O3 numerical_behavior · O2 expected_values · O2 numerical_behavior
- Interfaces
- PASS · UI (SSR) / REST / MCP / URL→result→graph
- Supplemental domain review
- Not performed
- Named expert review
- Not performed
- CVP suite
- 4/4 golden · 10/10 CVP boundary · 8/8 invalid · 5/5 property · 4/4 metamorphic · 4/4 round-trip · 16/16 O3 · 1/1 cross-interface · 11/11 cross-calculator · 4/4 URL→result→graph · 1/1 CVP contract · Manifest
- Sources
- NIST Digital Library of Mathematical Functions, Chapter 4
- NIST DLMF §4.14
- CalculatorX mathematical conventions
- Evidence
- 15 legacy golden · 10 legacy boundary · legacy regression suite · 4/4 oracle-backed golden · 8/8 invalid · Artifact integrity PASS
- Semantic contract
- PASS
Full verification
Formulas
Core equations used by this calculator.
How to use
Choose tan(θ) or angle from tan
The published engine computes tan(θ). Inverse mode is a local convenience; use Arctan for the published inverse.
Pick degrees or radians
Default unit is degrees. Avoid odd multiples of 90° (undefined). Share URLs include theta and unit.
Read the result
Exact labels appear for listed common-angle snaps. Classified poles (distance < 1e-12° from 90° + 180°k) return UNDEFINED; nearby angles stay finite with a Near singularity warning.
Example calculations
Common configurations with formula and result.
tan(45°)
Unit slope
tan(30°)
Classic
tan(60°)
√3
Undefined
tan(90°)
From tan
tan⁻¹(1)
Tangent common values
Common values at a glance.
| θ (°) | θ (rad) | tan θ |
|---|---|---|
| −60° | −π/3 | −√3 |
| −45° | −π/4 | −1 |
| −30° | −π/6 | −1/√3 |
| 0° | 0 | 0 |
| 30° | π/6 | 1/√3 |
| 45° | π/4 | 1 |
| 60° | π/3 | √3 |
| 90° | π/2 | undefined |
Tan calculator specification
Version 1.0.4 · Engine tested
- Engine tested 25/25 tests · Production surface contract 3/3
- Named expert review Not performed
- Calculation version 1.0.4
- Definition
- Tangent of an angle θ is the ratio of opposite to adjacent in a right triangle, equal to sin(θ)/cos(θ), and the slope of the ray on the unit circle. It is undefined when cos(θ) = 0 (odd multiples of 90°). Period is 180° (π); the function is odd: tan(−θ) = −tan(θ).
- What it calculates
- The real tangent y = tan(θ) = sin(θ)/cos(θ) when defined. Default unit is degrees.
- Inputs
- Angle θ (finite real, not an odd multiple of 90°)
- Optional unit: deg (default) or rad
- Outputs
- tan(θ), or error UNDEFINED at classified poles
- Optional warning NEAR_SINGULARITY when θ is extremely close to a pole
- Formula
y = tan(θ_rad); θ_rad = θ° × π/180 when unit is deg- Assumptions
- Real tangent only. Inverse is Arctan, not this published engine.
- Documented pole classification: UNDEFINED when distance to 90° + 180°k is < 1e-12°. That threshold is a numerical classification policy, not a claim that those inputs are mathematically exact odd multiples of 90°. |cos(θ)| is not used as a pole test.
- If the input is not classified as a pole and distance-to-pole < 0.01°, the engine returns a finite tan(θ) with warnings: [{ code: NEAR_SINGULARITY }]. status remains ok.
- Documented common-angle snap: after reducing mod 360°, an input within 1e-12° of a listed common angle (0, ±30, ±45, ±60, …) is replaced by the algebraic value (0, ±1/√3, ±1, ±√3). This is a snap policy, not mathematical exactness. Nearby inputs such as 60.00000005° keep IEEE-754 Math.tan.
- Documented cleanup: if no snap applies and |y| < 1e-12, the engine rewrites y to 0. That changes the IEEE-754 result for some non-zero inputs; it is a cleanup policy, not a mathematical identity.
- Units
- Dimensionless tangent value
- Degrees or radians for the angle
- Boundary conditions
- Missing θ returns MISSING_REQUIRED_INPUT. Invalid unit returns INVALID_UNIT. Malformed numbers return INVALID_NUMBER.
- tan(0°) = 0; tan(45°) = 1; tan(30°) = 1/√3; tan(60°) = √3; tan(−45°) = −1; tan(180°) = 0; tan(225°) = 1; tan(360°) = 0.
- tan(90°), tan(270°), tan(−90°), tan(π/2 rad) return UNDEFINED.
- tan(89°) and tan(91°) are large finite values, not UNDEFINED.
- Periodicity: tan(θ + 180°) = tan(θ), e.g. tan(405°) = tan(45°) = 1.
- Numerical precision
- IEEE-754 binary64 Math.tan after converting degrees with θ × π/180, unless a documented pole classification, common-angle snap, or |y| cleanup applies.
- Common-angle snap uses a 1e-12° classification window on the reduced angle. It is not bitwise identity with the listed degree, and it is not a claim that the input is mathematically exact.
- Documented cleanup: remaining |y| < 1e-12 becomes 0 in the published REST/SSR number. The page may show an exact label only for listed snaps.
- tan(θ + 180°) = tan(θ) is exact at listed snaps. Off-snap, degree → radian conversion can leave a few to tens of ULP; that identity is not a ≤2 ULP binary64 claim.
- Interactive evaluation runs in the browser. Shared URLs and REST use the same engine server-side. CVP interface evidence is UI (SSR) plus URL → result → graph; hydration, slider, and history are not a live browser session.
- The Result Card includes an engine-linked Live graph of y = tan(θ) using the same Overview / Focus template as Log. Vertical asymptotes at odd multiples of 90° are drawn as faint dashed lines; the curve is gapped across poles, not connected.
- Example
- tan(45°) = 1 (listed snap); tan(90°) is classified UNDEFINED; tan(89.99999995°) is a large finite value with NEAR_SINGULARITY
- Validation cases
17 published on this page · 25/25 tests · Production surface contract 3/3 · View evidence
- theta=45, unit=deg → 1
- theta=30, unit=deg → 1/√3
- theta=60, unit=deg → √3
- theta=0, unit=deg → 0
- theta=-45, unit=deg → -1
- theta=180, unit=deg → 0
- theta=225, unit=deg → 1
- theta=360, unit=deg → 0
- theta=405, unit=deg → 1 (periodicity tan(θ+180°)=tan(θ))
- theta=89, unit=deg → ≈57.29 (finite, not UNDEFINED)
- theta=90, unit=deg → error UNDEFINED
- theta=270, unit=deg → error UNDEFINED
- theta=-90, unit=deg → error UNDEFINED
- theta=π/4, unit=rad → 1
- theta=π/2, unit=rad → error UNDEFINED
- theta=89.99999995, unit=deg → finite value + warning NEAR_SINGULARITY
- empty theta → error MISSING_REQUIRED_INPUT
- Sources
- NIST Digital Library of Mathematical Functions, Chapter 4 — Elementary FunctionsSupports: Tangent as sin/cos with period π and poles where cos = 0
- NIST DLMF §4.14 — Trigonometric functionsSupports: tan(θ) undefined at odd multiples of π/2; degree input converted via θ° × π/180
- CalculatorX mathematical conventions — Poles are UNDEFINED, not Infinity; inverse is ArctanSupports: Published engine is forward tan(θ) only. Pole classification, common-angle snap, and |y| cleanup are documented numerical policies, not mathematical exactness. Near-pole values stay finite with NEAR_SINGULARITY.
- NIST Digital Library of Mathematical Functions, Chapter 4 — Elementary Functions
- Calculation version
- 1.0.4
Background
Interpretation and common distinctions.
What tangent is
Tangent is one of the six basic trigonometric functions. For an acute angle in a right triangle:
tan(θ) = opposite/adjacent
Equivalently:
tan(θ) = (sin(θ))/(cos(θ))
The name comes from a line segment tangent to the unit circle. The function is odd and has period 180° (π):
tan(−θ) = −tan(θ), tan(θ + 180°) = tan(θ)
When tan is undefined
tan(θ) is undefined whenever cos(θ) = 0:
θ = 90° + 180° k (k ∈ ℤ)
Examples: ± 90°, ± 270°, π/2, 3π/2.
Degrees or radians
| Unit | Typical use | Conversion |
|---|---|---|
| Degrees (°) | Geometry | θ(rad) = θ° × π/180 |
| Radians | Calculus, most code libraries | θ° = θ(rad) × 180/π |
Example: tan(π/4) = tan(45°) = 1.
Graph sketch
y = tan(θ)
- Period 180° (π); odd function
- Vertical asymptotes at odd multiples of 90° are drawn as faint dashed lines; the curve is gapped, not connected across the pole
- Classified poles return UNDEFINED, not Infinity; nearby angles stay finite with a Near singularity warning
Use Arctan for the published inverse.
CVP (Calculator Verification Protocol)
Math graph pilot under CVP 1.0 Proposed. Profile: core (pure tangent transform, not an engineering model).
- Evidence Manifest: /evidence/math.tan/1.0.4.cvp.json
- Reproduce: /evidence/math.tan/reproduce — tabulated O3 inputs, expected values, generator, and re-run commands
- Independent reference: O1 (NIST DLMF model) + O3 mpmath/MPFR expected values and numerical behavior + O2 live identities
- Numerical policy: IEEE-754 binary64; ≤2 ULP vs O3 applies to the 16 published tabulated vectors (common angles away from poles plus 8 seeded random angles in (−50°, 50°)). It is not a guarantee over the entire real line, including poles, huge angles, or unlisted neighborhoods of zeros.
declared_before_evaluation=true - Cross-calculator (
CVP-XCAL-01):arctan(tan θ) ≈ θvs published Arctan on the principal range;1 + tan²θ = sec²θvs Cos;1 + cot²θ = csc²θvs Sin off zero. Listed Arcsin does not share those identities (N/A). Huge angles and poles are N/A after binary64 phase-bit loss. - Interfaces: UI (SSR), REST, and MCP must agree. A separate integration check covers URL → result → Live graph.
ui-ssris not a live browser session and is not a claim of live UI verified. - Versions stay distinct: calculation
1.0.4· CVP Proposed 1.0 · evidence revision2026-09-08.policy. Adding verification does not by itself change the tangent algorithm. - Public claim: CalculatorX CVP Verified · Core · Proposed 1.0 · Evidence available · Independent expert review not performed. That is CalculatorX's own verification, not a third-party audit.
- Expert review is optional and is not required for CVP Verified.
Related tools
Other calculators in this family: Arccos Calculator, Arcsin Calculator, Arctan Calculator, Cos Calculator, Pythagorean Theorem Calculator, Sin Calculator, Triangle Solver . Explore all Trigonometry & Triangles.
Frequently asked questions
Key distinctions behind the calculation.
What is the tangent function?
In a right triangle, tan(θ) = opposite / adjacent. Equivalently tan(θ) = sin(θ)/cos(θ). On the unit circle it relates to the slope of the ray at angle θ.
When is tan undefined?
Mathematically when cos(θ) = 0, i.e. θ = 90° + 180°k. This engine classifies an input as UNDEFINED when its distance to that pole is under 1e-12°. That is a numerical classification policy, not a claim that those floats are mathematically exact. Outside that window, nearby angles stay finite with a NEAR_SINGULARITY warning.
What is the period of tan?
180° or π radians: tan(θ + 180°) = tan(θ).
Is tangent odd?
Yes. tan(−θ) = −tan(θ).
What is tan(45°)?
Exactly 1.
Should I use degrees or radians?
Use the unit in your problem. Most programming and statistics libraries take radians; convert with θ_rad = θ° × π/180.
How do I find the angle from a tangent value?
Use inverse mode here (principal value in (−90°, 90°)) or the Arctan calculator for more detail.