StringMash.com

Right triangle calculator

Two values in, the rest of the right triangle out, with SOH CAH TOA or Pythagoras shown step by step.

Solve a right triangle

C is the right angle, so c is the hypotenuse. Type any two more values, at least one a side. Roots like 5√2 work, and so does π/6 in radians.

Solved from two sides and the angle between them (SAS).

Triangle with a = 5, b = 12, c = 13, drawn to scaleA 22.6°B 67.4°C 90°a = 5b = 12c = 13
Scalene right triangle. Drawn to scale; the dashed line is the height from C.
PartValueExact
Side a given5
Side b given12
Side c13
Angle A22.6199°
Angle B67.3801°
Angle C given90°
Area30
Perimeter30
Semiperimeter s15
Height to a (h_a)12
Height to b (h_b)5
Height to c (h_c)4.615460/13
Inradius r2
Circumradius R6.5
Working
  1. Law of cosines. c² = a² + b² − 2ab cos C = 5² + 12² − 2 × 5 × 12 × cos 90° = 169, so c = √169 = 13
  2. Law of cosines. cos A = (b² + c² − a²) / (2bc) = (12² + 13² − 5²) / (2 × 12 × 13) = 0.923077 (exactly 12/13), so A = arccos(0.923077) = 22.6199°
  3. Angle sum. B = 180° − C − A = 180° − 90° − 22.6199° = 67.3801°
  4. Perimeter. a + b + c = 5 + 12 + 13 = 30
  5. Heron's formula. s = (a + b + c)/2 = 15; area = √(s(s − a)(s − b)(s − c)) = √(15 × 10 × 3 × 2) = 30
  6. Area from two sides. ½ab sin C = ½ × 5 × 12 × sin 90° = 30, the same area
  7. Heights. h = 2 × area / base: h_a = 12, h_b = 5, h_c = 4.6154
  8. Inradius and circumradius. r = area / s = 2; R = a / (2 sin A) = 6.5

How to use it

Angle C is fixed at 90°, so side c is the hypotenuse, the longest side, opposite the right angle. Sides a and b are the legs. Type any two more values, and at least one of them has to be a side.

Two sides give the third by Pythagoras and the angles by inverse trig. A side and an angle give the rest by sine, cosine or tangent. Two angles alone won't do, since they fix the shape but not the size.

You get every side and angle back, along with the area, the perimeter and the height from the right angle down to the hypotenuse, also called the altitude. The working names the ratio used at each step, and it all runs in your browser.

SOH CAH TOA

Three ratios link an angle of a right triangle to its sides. Name the sides from the angle you're working with. The opposite side faces it, the adjacent side runs along it to the right angle, and the hypotenuse is always the longest.

SOH CAH TOA packs the three into one word. Sine is Opposite over Hypotenuse, Cosine is Adjacent over Hypotenuse, and Tangent is Opposite over Adjacent. It's said to rhyme with Krakatoa.

If the word won't stick, some people use a sentence instead, such as "Some Old Horses Chew Apples Happily Throughout Old Age". The first letters spell the same thing.

The three ratios

For angle A in a right triangle with C = 90°.
RatioRuleFor angle AUse it when you know
sin AOpposite ÷ hypotenusea / cThe hypotenuse and the side facing the angle
cos AAdjacent ÷ hypotenuseb / cThe hypotenuse and the side next to the angle
tan AOpposite ÷ adjacenta / bBoth legs

Worked example: two legs

Legs a = 5 and b = 12. Pythagoras gives the hypotenuse, c = √(5² + 12²) = √169 = 13, which makes 5, 12, 13 one of the whole-number triples.

For angle A, both legs are known, so use tangent. tan A = 5/12, and A = arctan(5/12) = 22.6199°. The two acute angles of a right triangle add up to 90°, so B = 67.3801°.

The area is half the product of the legs, ½ × 5 × 12 = 30. The height from the right angle to the hypotenuse is 2 × 30 ÷ 13 = 4.6154.

Worked example: hypotenuse and an angle

A hypotenuse of 10 and A = 40°. The side opposite A is a = 10 sin 40° = 6.4279. The side next to it is b = 10 cos 40° = 7.6604, and B = 50°.

Pythagoras checks it. 6.4279² + 7.6604² = 41.318 + 58.682 = 100, and √100 = 10.

Worked example: a ladder

A 6 m ladder stands with its foot 1.5 m from the wall. How steep is it, and how high up the wall does it reach?

Ladder first. It's the hypotenuse, c = 6, and the gap at the bottom is the leg next to the ground angle. Put it in as b = 1.5, so the ground angle is A, and cos A = 1.5/6 = 0.25. A = arccos(0.25) = 75.5225°.

The height up the wall is a = √(6² − 1.5²) = √33.75, exactly 3√15/2, which is 5.8095 m.

Exact values worth knowing

Type these angles and the calculator keeps the roots.
Anglesincostan
30°1/2√3/2√3/3
45°√2/2√2/21
60°√3/21/2√3
15°(√6 − √2)/4(√6 + √2)/42 − √3
75°(√6 + √2)/4(√6 − √2)/42 + √3

Pythagoras or trig?

Use Pythagoras, a² + b² = c², when you know two sides and want the third. The Pythagorean theorem calculator does this with the steps shown.

Use SOH CAH TOA whenever an angle is involved, either because you were given one and want a side, or because you have two sides and want to know how steep, wide or sharp the corner between them is. For a triangle without a right angle, the triangle calculator switches to the laws of sines and cosines. For the 30-60-90 and 45-45-90 shapes, the special right triangles page gives the ratios in exact form.

Questions

Which side is the hypotenuse?

The one opposite the right angle. It's always the longest side. Here that's side c.

How do I find an angle from two sides?

Pick the ratio that uses the two sides you have, then take its inverse. With opposite 5 and adjacent 12, tan A = 5/12 and A = arctan(5/12) = 22.6199°. On a calculator, arctan is often labelled tan⁻¹.

How do I find a side from an angle and a side?

Write the ratio that links them and rearrange. With hypotenuse 10 and A = 40°, sin 40° = a/10, so a = 10 sin 40° = 6.4279.

What's the area of a right triangle?

Half the product of the two legs. Legs 5 and 12 give 30.

Why can't I give it two angles?

Two angles fix the shape, and in a right triangle one angle is already known. Without a side there's no size, so any enlargement would fit.

Why must the hypotenuse be the longest side?

Because c² = a² + b², and each leg squared is less than that sum. If you type a leg longer than the hypotenuse, no right triangle fits.

Sources

Added and reviewed . What's new