40% OFF! — Limited Time Offer
← Back to Articles

July 19, 2026

·By El Alaoui Mohamed

Trigonometric Functions in Revit: sin(), cos(), tan(), atan()

Trigonometric functions driving slopes and rotations in Revit families

TL;DR

Revit formulas include the full trig set — sin(), cos(), tan() take an angle and return a number; asin(), acos(), atan() take a number and return an angle. The two workhorse patterns: atan(Rise / Run) turns two lengths into a slope angle, and Length * sin(Angle) / cos(Angle) projects lengths along angles for braces, ramps, and rotated geometry. Remember the units: trig inputs and outputs mix angles, numbers, and lengths in specific ways.

Key Takeaways

  • sin(), cos(), tan() take an angle, return a plain number; multiply by a length to get a projection.
  • asin(), acos(), atan() go the other way: number in, angle out.
  • The slope pattern: Angle = atan(Rise / Run) — two lengths become an angle in one line.
  • The projection pattern: Horizontal = Brace_Length * cos(Angle), Vertical = Brace_Length * sin(Angle).
  • Angle parameters keep rotated geometry parametric — no manual rotation survives a resize.
  • Guard divisions: tan(90°) and division by a zero Run break the family — clamp inputs with IF.

Rectangles only need arithmetic. The moment a family leans, slopes, rotates, or bends — roof brackets, ramps, diagonal braces, stair components, pipe offsets at 45° — the geometry runs on triangles, and triangles run on trig. Revit's formula engine has the complete toolkit built in.

The Six Functions and Their Units

FunctionInputOutputTypical use
sin(x)AngleNumberVertical projection
cos(x)AngleNumberHorizontal projection
tan(x)AngleNumberSlope ratio from an angle
asin(x)NumberAngleAngle from a height ratio
acos(x)NumberAngleAngle from a width ratio
atan(x)NumberAngleSlope angle from rise/run

The unit logic matters: sin(Angle) is a pure number, so Length * sin(Angle) is a length — exactly what a dimension parameter wants. Feeding atan() the ratio of two lengths works because the units cancel in the division, as explained in the arithmetic chapter.

Pattern 1 — Slope Angle From Two Lengths

The single most useful trig line in Revit. A ramp family where the user enters rise and run, and the angle calculates itself:

Slope_Angle = atan(Rise / Run)

1:12 accessibility ramp? atan(1 / 12) = 4.76°. The angle parameter can now drive rotated geometry, feed a schedule, or gate a compliance flag:

Is_ADA_Compliant = Slope_Angle <= 4.77°

Pattern 2 — Projecting a Length Along an Angle

A diagonal brace of known length at a known angle needs its horizontal and vertical footprint for the host geometry:

Horizontal_Reach = Brace_Length * cos(Brace_Angle) Vertical_Reach = Brace_Length * sin(Brace_Angle)

Or inverted — the brace must span a known height at a chosen angle:

Brace_Length = Height / sin(Brace_Angle)

Pattern 3 — Roof and Canopy Components

A canopy support bracket that follows the roof pitch:

Strut_Length = Overhang / cos(Roof_Pitch) Drop_Height = Overhang * tan(Roof_Pitch)

Pattern 4 — Chord and Sagitta for Curves

Curved geometry — arched openings, bent rails — reduces to chords and radii. The sagitta (arc height) of a curved header:

Half_Angle = asin((Chord / 2) / Radius) Sagitta = Radius * (1 - cos(Half_Angle))

Two Failure Modes to Guard

Division by zero. atan(Rise / Run) dies when Run = 0mm. Guard it with an IF statement or a sensible minimum constraint on the parameter.

Out-of-range inverse inputs. asin() and acos() only accept values from −1 to 1. If (Chord / 2) / Radius can exceed 1 — a chord wider than the diameter — the formula fails. Clamp the inputs, and when a family breaks anyway, the isolation method in the debugging chapter finds the offending value fast.

Chapter 8 of 10

Slopes and curves that flex precisely

All 10 formula chapters with worked examples, HD Video Vault, and the Formula Cheat Sheet. 40% off at $18.