Math
TAN function: calculate mast or roof height from horizontal run and angle
Multiply horizontal ground distance by TAN(RADIANS(angle)) to find vertical height, and guard 90-degree vertical asymptotes.
Turn horizontal run and sight angle into vertical height
In right-triangle surveying and roof framing, TAN(angle) = Opposite (Rise) / Adjacent (Run). Standing 40 m from a tower with a 45° sight angle and 1.6 m instrument height gives 40 * TAN(RADIANS(45)) + 1.6 = 41.6 m.
The example assumes level ground and a horizontal distance to the tower base. Measurements close to 90 degrees are extremely sensitive to angle error, even when they do not equal 90 exactly.
| GroundRunM (A) | SightAngleDeg (B) | EyeHeightM (C) | TotalHeightM |
|---|---|---|---|
| 40 | 45 | 1.6 | 41.6 |
Calculate total structure height
Because TAN(RADIANS(45)) = 1, rise equals run (40 m), plus 1.6 m eye level = 41.6 m.
=ROUND(A2 * TAN(RADIANS(B2)) + C2, 2)Guard 90° vertical angles where tangent is undefined
At ±90°, cosine is zero in exact math (and ~6.12E-17 in floating-point radians, producing ~1.63E+16). Guarding MOD(ABS(B2), 180)=90 flags vertical sightlines cleanly.
=IF(MOD(ABS(B2), 180)=90, "Vertical undefined", ROUND(A2 * TAN(RADIANS(B2)) + C2, 2))Try the example
Use the original values or change them to test your understanding.