Skip to content

Right triangle calculator for fabrication: diagonal, squareness, angle and slope

Updated on 20 November 2026

Right triangles are all over fabrication: the diagonal that squares a frame, the knee brace under a shelf, the stair stringer, the roof truss. It is always the same math — the Pythagorean theorem and a little trigonometry — and the calculator does both with shop measurements, in inches or millimeters.

The 45° corner of a square tube frame is the square tube miter, and the post meeting the rail is the square tube tee.

Right triangle calculator

Pick the two values you know — run and rise, run and diagonal, run and angle, diagonal and angle — and type them in. You get the diagonal, the run and the rise, both angles and the slope.

Only paying users can use this calculator

The formula and the worked example are in the text on this page. The calculator, with your own measurements, is part of full access.

Buy full access Already have access? Sign in

The formulas

Diagonal (Pythagoras)
c = √(a² + b²) a is the run and b the rise, the legs; c is the hypotenuse, the diagonal of an a × b rectangle.
Base angle
α = atan(b / a) The angle between the run and the diagonal. The top angle is β = 90° − α.
Rise and diagonal from run and angle
b = a × tan α ; c = a / cos α
Slope
i = b / a × 100 % 100 % is a 45° angle. Roofers say it as rise per 12 of run: 9 in 12 is 75 %.

Worked example: squaring a gate frame

A gate frame 96 × 72 inches:

  1. Diagonal: √(96² + 72²) = 120", or 10' 0". Both diagonals of the frame must read 120".
  2. Angle of the diagonal with the run: atan(72 / 96) = 36.87°; with the rise, 53.13°.
  3. If one diagonal reads 120-1/4" and the other 119-3/4", the frame is out of square: push the corner of the long diagonal until both match.

In millimeters, a 2000 × 1500 mm frame has a 2500 mm diagonal; a stringer with a 3000 mm run at 30° rises 1732.1 mm.

The 3-4-5 rule

Without a calculator, square a corner with the 3-4-5 triangle: mark 3 units along one edge and 4 along the other, from the corner; if the marks are 5 apart, the corner is 90°. Use multiples for accuracy: 3, 4 and 5 feet, or 6, 8 and 10 feet.

Frequently asked questions

How do I find the diagonal of a rectangle?
With the Pythagorean theorem: the square root of the sum of the squares of the sides. A 96 × 72 inch frame has a √(96² + 72²) = 120 inch diagonal.
How do I check a gate frame for square?
Measure both diagonals, corner to corner: on a square frame they read the same. If one is longer, push its corner until they match.
How do I find the angle of a right triangle?
With the arc tangent of rise over run: α = atan(b / a). A 72 inch rise over a 96 inch run is 36.87°.

Parts in this guide

Other guides