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
| Function | Input | Output | Typical use |
|---|---|---|---|
| sin(x) | Angle | Number | Vertical projection |
| cos(x) | Angle | Number | Horizontal projection |
| tan(x) | Angle | Number | Slope ratio from an angle |
| asin(x) | Number | Angle | Angle from a height ratio |
| acos(x) | Number | Angle | Angle from a width ratio |
| atan(x) | Number | Angle | Slope 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:
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:
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:
Or inverted — the brace must span a known height at a chosen angle:
Pattern 3 — Roof and Canopy Components
A canopy support bracket that follows the 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:
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.
