CNC / machinist calculator

Right Triangle (Trig) Calculator

The right-triangle solve is the most common piece of math at a machine: find a missing side or angle on a print, lay out a chamfer, or work out the rise over a run. Pick what you know, two sides or a side and an angle, and this calculator returns every remaining side and angle. It saves digging out the sine, cosine and tangent for layout, taper and bolt-pattern work.

Leg a
Leg b
Hypotenuse c
Angle A
Angle B
Saved setups

Saved in this browser only. Export to move setups between machines.

How it works

A right triangle has one ninety degree corner, two other angles that add to ninety, and three sides: the two legs and the hypotenuse opposite the right angle. Knowing any two parts, as long as one is a side, fixes the whole triangle. The relationships are the Pythagorean theorem for the sides and the basic trig ratios for the angles.

The hypotenuse is the square root of the sum of the squares of the legs, and a missing leg is the square root of the hypotenuse squared minus the known leg squared. An angle comes from the inverse sine, cosine or tangent of the appropriate pair of sides, and a side comes from a known angle and the hypotenuse through sine and cosine. The two acute angles always sum to ninety degrees, which is a quick check on any answer.

For oblique triangles without a right angle you need the law of sines or cosines, but a surprising amount of shop layout reduces to a right triangle once you drop a perpendicular, which is why this solve is the one worth keeping a click away.

c = sqrt(a^2 + b^2) | angle A = atan(a / b) | a = c x sin(A), b = c x cos(A)

Worked example

Legs of 3 and 4 give a hypotenuse of 5 (the 3-4-5 triangle), with angles of about 36.9 and 53.1 degrees that sum to 90.

Frequently asked questions

How do I find the hypotenuse of a right triangle?

Take the square root of the sum of the squares of the two legs. For legs of 3 and 4 the hypotenuse is the square root of 9 plus 16, which is the square root of 25, so 5.

How do I find an angle from two sides?

Use the inverse trig ratio for the sides you have: inverse tangent of the opposite over the adjacent leg, inverse sine of the opposite over the hypotenuse, or inverse cosine of the adjacent over the hypotenuse.

What if my triangle has no right angle?

Then use the law of sines or the law of cosines instead, because the simple ratios assume a ninety degree corner. Often you can split an oblique triangle into two right triangles by dropping a perpendicular.

Why do the two acute angles add to 90?

Every triangle's angles sum to 180 degrees, and a right triangle already uses 90 of that for its right angle, so the two remaining acute angles must add to the other 90 degrees. It is a fast sanity check.

Can I use this for a taper or chamfer angle?

Yes. Treat the rise as one leg and the run as the other, and the inverse tangent of rise over run gives the angle. For a chamfer, the leg lengths are the horizontal and vertical faces of the cut.

Related calculators

Sources

Every formula on this page is shown and sourced. See how we verify.

These calculators are for planning and as a starting point. Recommended speeds and feeds are published starting values that vary with your specific tool, coating, machine rigidity, workholding and coolant. Always start conservative, listen to the cut, and follow your tool maker data sheet.