Skip to content
Tutorials Center
My learning

Topics

Lesson 6 of 38 · Right Triangle Trigonometry

Solving Right Triangles

Find every missing side and angle of a right triangle using SOH CAH TOA, Pythagoras and the inverse functions sin⁻¹, cos⁻¹ and tan⁻¹, with a full solver.

To solve a right triangle means to find all of its missing sides and angles. A right triangle has six measurements (three sides, three angles). One angle is always 90°, so you need two more pieces of information, at least one of which is a side, to find the rest.

The tools you need are SOH CAH TOA for sides, the Pythagorean theorem as a check, the rule that the acute angles add to 90°, and the inverse trig functions for finding angles.

Inverse functions: from ratio to angle

So far you gave an angle and got a ratio. Often you know the ratio and want the angle. The inverse functions do this:

  • sin⁻¹(x) (also called arcsin) gives the acute angle whose sine is x.
  • cos⁻¹(x) (arccos) gives the angle whose cosine is x.
  • tan⁻¹(x) (arctan) gives the angle whose tangent is x.

The ⁻¹ does not mean "one over". It means "inverse function". On a calculator these are the shifted or second-function keys. In Python they are math.asin, math.acos, math.atan, and they return radians, so convert with math.degrees.

Example. If sin θ = 0.5 then θ = sin⁻¹(0.5) = 30°.

Python Inverse functions

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Case 1: two sides known

Problem. A right triangle has legs 9 and 12. Solve it.

  1. Hypotenuse: c = √(9² + 12²) = √225 = 15.
  2. Angle A opposite the side 9: tan A = 9/12 = 0.75, so A = tan⁻¹(0.75) ≈ 36.87°.
  3. Angle B: B = 90° − 36.87° = 53.13°.

Check: sin A = 9/15 = 0.6, and sin 36.87° ≈ 0.6. Good.

Case 2: one side and one acute angle known

Problem. The hypotenuse is 20 and angle A = 25°. Solve it.

  1. Angle B = 90° − 25° = 65°.
  2. Side opposite A: a = 20 × sin 25° ≈ 8.45.
  3. Side adjacent to A: b = 20 × cos 25° ≈ 18.13.
  4. Check with Pythagoras: 8.45² + 18.13² ≈ 71.4 + 328.7 ≈ 400 = 20².

A general solver

Here is a function that takes any valid combination for a right triangle with angle A at one end, side a opposite A, side b adjacent, and hypotenuse c.

Python Right triangle solver

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

This solver applies the formulas from this lesson. It does not check every possible invalid input; for instance, it does not complain if you give an angle outside 0° to 90°.

Case 3: hypotenuse and a leg

Problem. The hypotenuse is 10 and one leg is 6.

  • Other leg: b = √(100 − 36) = 8.
  • Angle opposite the 6: sin A = 6/10 = 0.6, A = sin⁻¹(0.6) ≈ 36.87°.
  • B ≈ 53.13°.

Notice that this is the same triangle as the 3-4-5 triangle scaled by 2.

Choosing the method

flowchart TD
    S["What do you know?"] --> T["Two sides"]
    S --> U["One side and one angle"]
    T --> V["Pythagoras for the third side<br/>then inverse trig for an angle"]
    U --> W["Other angle = 90° minus the known one<br/>then SOH CAH TOA for sides"]

Two sides lead to inverse functions; one side and an angle lead to direct ratios.

Rounding advice

  • Keep extra decimals in the middle of a calculation and round only the final answer.
  • For lengths, two or three decimals is typical; for angles, one or two.
  • Always check that the hypotenuse is the longest side.

Worked example: a ramp

A wheelchair ramp rises 0.9 m over a horizontal distance of 10.8 m. What angle does the ramp make with the ground, and how long is the ramp surface?

  • Angle: tan θ = 0.9 / 10.8, so θ = tan⁻¹(0.0833) ≈ 4.76°.
  • Length: √(0.9² + 10.8²) ≈ 10.84 m.
Python Ramp calculator

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What does sin⁻¹(0.5) give?

    The superscript minus one marks the inverse function, which returns an angle.
  2. 2. Legs 5 and 12. What is the hypotenuse?

    25 + 144 = 169, and the square root is 13.
  3. 3. A right triangle has one acute angle of 38 degrees. What is the other?

    The acute angles add up to 90 degrees: 90 - 38 = 52.
  4. 4. Which function finds an angle when you know the opposite and adjacent sides?

    Opposite over adjacent is the tangent ratio, so use tan⁻¹.

Summary

  • Solving a right triangle means finding all sides and angles.
  • Two sides: use Pythagoras and an inverse trig function.
  • One side and one acute angle: the other angle is 90° − A, then use SOH CAH TOA.
  • Inverse functions turn a ratio into an angle; programming libraries return radians.
  • Round only at the end.

Next: Special Angles: 30°, 45°, and 60°