Math & Trig

TAN Formula

TAN returns the tangent of an angle in radians. Tangent equals sin/cos and represents the slope of a line at that angle. It's used for calculating slopes, heights from angles of elevation, and in surveying and navigation. Note that TAN is undefined at 90° (π/2) and its odd multiples.

Syntax

TAN(number)
ParameterDescription
number Parameter of the TAN function.
Try TAN in Viztab — free, no signup

Examples

Tangent of 45 degrees

Formula
=TAN(PI()/4)
Returns 1. The tangent of 45° is exactly 1, meaning a 45° slope rises 1 unit for every 1 unit of horizontal distance.

Height from angle

Formula
=100*TAN(RADIANS(35))
Returns ~70.02. Standing 100 meters from a building, looking up at 35°, the building is about 70 meters tall (height = distance × tan(angle)).

Roof pitch

Formula
=DEGREES(ATAN(6/12))
Returns ~26.57°. A 6:12 roof pitch (6 inches rise per 12 inches run) corresponds to about 26.6 degrees. (Uses ATAN, the inverse of TAN.)

Common Errors

#VALUE!

Non-numeric input returns #VALUE!.

#NUM!

TAN approaches infinity near π/2 (90°). While it won't error at exactly PI()/2 due to floating point, the result will be extremely large.

Tips

Slope = TAN(angle)

A line's slope equals the tangent of its angle with the horizontal. A 45° line has slope = TAN(45°) = 1.

Undefined at 90°

TAN is undefined at 90° (and 270°, etc.) because COS is zero there. Results near these angles will be extremely large numbers.

Surveying applications

Height = distance × TAN(elevation_angle). Distance = height / TAN(elevation_angle). These are the basic surveying formulas.

Try TAN in Viztab

Import your data and use TAN with 370+ other formulas. No signup required.

Open Viztab

Related Formulas