Contact

TAN Function (Gnumeric)

Math Beginner Gnumeric

Learn the TAN function in Gnumeric: Returns the tangent of a number.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

TAN returns the tangent of an angle in radians. In right-triangle geometry, it is the ratio of opposite side to adjacent side. It can convert an inclination to rise per unit of horizontal run when the angle is in the correct unit and safely away from a tangent singularity.

Syntax and units

=TAN(x)

x is one required numeric angle in radians. For degrees, use =TAN(RADIANS(degrees)). No optional unit argument is available. A displayed degree symbol does not change the stored value’s interpretation.

The mathematical tangent repeats every PI() radians and changes sign with its argument’s sign. It is undefined at PI()/2 plus an integer multiple of PI(). Those singularities require special care in floating-point calculations.

Retained starting example

=TAN(0)

The expected result is 0. A horizontal line has zero rise over a nonzero horizontal run.

Make a slope table

Put 0, 30 and 45 in A2:A4 under an Angle in degrees heading. Enter =TAN(RADIANS(A2)) in B2 and fill down. Approximate slopes are 0, 0.5773502692 and 1.

At 45 degrees, opposite and adjacent lengths are equal, giving ratio 1. At 30 degrees the ratio is 1/SQRT(3), approximately 0.5773502692. The alternative control =TAN(PI()/4) is approximately 1. =TAN(45) uses 45 radians and is not a 45-degree calculation.

Advanced application: rise and grade

For a 100-unit horizontal run inclined at 5 degrees, put 100 in D2 and 5 in E2. =D2*TAN(RADIANS(E2)) gives a rise of approximately 8.748866353 units.

The grade ratio is =TAN(RADIANS(E2)), approximately 0.08748866353. Applying percentage formatting displays approximately 8.748866353%. Multiplying by 100 as well as formatting as a percentage would use a different storage convention and can exaggerate the displayed result by a factor of 100.

An inverse check is =DEGREES(ATAN(8.748866353/100)), approximately 5 degrees, with a small difference caused by the rounded rise. Retaining full precision improves the round trip. The rise and horizontal run must share a unit.

Singularities and troubleshooting

Near 90 degrees, a tiny angle change creates a large slope change. A worksheet representation of PI()/2 is approximate, so TAN(PI()/2) may produce a large finite value rather than a tidy undefined-value error. That finite value should not be trusted as a physical slope at the singularity.

Set an application-specific rule for angles too close to vertical before using the model. The appropriate tolerance depends on measurement precision and purpose; no universal cutoff is claimed here. Singular or extreme inputs were deliberately excluded from the bounded controls.

For unexpected results, check units, quadrant and upstream numeric data. Split a text label such as “5 degrees” into a numeric value and a separate unit. A valid numeric result alone does not verify that the angle described the intended geometry.

Availability and verification

Version coverage: Gnumeric 1.12.57 has the scoped checks below. The 1.12.62 evidence is a documentation/source check dated October 14, 2026.

  • Introduced: Original introduction not established. The earliest demonstrated support in this guide is 1.12.57.
  • Availability: Supported in Gnumeric 1.12.62, based on the function-specific registration.
  • Scope: Desktop; the fn-math function module must be included and enabled.
  • Checked: October 14, 2026. Documentation/source check; no new native test in Gnumeric 1.12.62.

The executable contract is also present in the official Gnumeric 1.12.57 fn-math source. The saved source was originally retrieved on October 17, 2026 and re-inspected for this guide. The last functioning release is not established; support in a named version is not a retirement claim.

On October 17, 2026, Gnumeric ssconvert 1.12.57 recalculated a synthetic workbook in the C.UTF-8 locale. Scoped controls: =TAN(0) → 0; =TAN(PI()/4) → 0.9999999999999999; =TAN(RADIANS(30)) → 0.5773502691896257; =100*TAN(RADIANS(5)) → 8.748866352592401. These are native calculation-engine results, not GUI tests or screenshots. Other tutorial layouts and displayed outputs are independent expectations unless covered by these exact formulas. Input/output files, preserved formulas, raw values and hashes were retained. The XLSX importer logged an unused workbookProtection-element warning; changed-input controls and recorded results were checked.

Official references