Skip to content
Tutorials Center
My learning

Topics

Lesson 3 of 38 · Getting Started

Triangles and the Pythagorean Theorem

Review triangle types, the angle sum rule, and the Pythagorean theorem, with worked examples and a runnable checker for right triangles.

Triangles are the starting point of trigonometry. Before we define sine, cosine, and tangent, you need to be comfortable with the parts of a triangle and with the one rule that links the sides of a right triangle: the Pythagorean theorem.

Types of triangles

We classify triangles in two ways.

By sides

  • Equilateral: all three sides equal (and all angles 60°).
  • Isosceles: at least two sides equal (the angles opposite them are equal).
  • Scalene: no sides equal.

By angles

  • Acute: all angles less than 90°.
  • Right: one angle exactly 90°.
  • Obtuse: one angle greater than 90°.

The angle sum rule

The three angles of any triangle in a flat plane add up to 180°. If you know two angles, you can always find the third.

Example. A triangle has angles 47° and 85°. The third angle is 180° − 47° − 85° = 48°.

In a right triangle one angle is 90°, so the other two must add to 90°. They are complementary.

Parts of a right triangle

In a right triangle the side opposite the right angle is the hypotenuse. It is always the longest side. The other two sides are the legs.

flowchart TB
    R["Right angle 90°"] --- L1["Leg a"]
    R --- L2["Leg b"]
    L1 --- H["Hypotenuse c<br/>opposite the right angle"]
    L2 --- H

The hypotenuse faces the right angle; the legs meet at it.

The Pythagorean theorem

In a right triangle with legs a and b and hypotenuse c:

a² + b² = c²

This says the square built on the hypotenuse has the same area as the two squares on the legs together. It works only for right triangles.

Example 1: find a hypotenuse. Legs 6 cm and 8 cm. c² = 6² + 8² = 36 + 64 = 100, so c = √100 = 10 cm.

Example 2: find a leg. Hypotenuse 13 m, one leg 5 m. b² = 13² − 5² = 169 − 25 = 144, so b = 12 m.

Python Pythagorean 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.

Pythagorean triples

Sets of three whole numbers that satisfy a² + b² = c² are called Pythagorean triples. Famous ones are (3, 4, 5), (5, 12, 13), (8, 15, 17), and (7, 24, 25). Any multiple of a triple, like (6, 8, 10), is also a triple. Builders use the 3-4-5 triple to check that a corner is square.

The next program searches for all triples with c up to a limit.

Python Find Pythagorean triples

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.

Testing for a right triangle

The converse also holds. If three sides satisfy a² + b² = c² (with c the longest), the triangle has a right angle. If a² + b² > c² the triangle is acute; if a² + b² < c² it is obtuse.

Example. Sides 7, 9, 12: the longest is 12. 7² + 9² = 49 + 81 = 130 and 12² = 144. Since 130 < 144, the triangle is obtuse.

Python Classify a triangle by its sides

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.

Worked example: a ladder

A 5 m ladder leans against a wall with its foot 1.4 m from the wall. How high up the wall does it reach?

The ladder is the hypotenuse (5 m), the ground distance is one leg (1.4 m). The height is the other leg:

h² = 5² − 1.4² = 25 − 1.96 = 23.04, so h = 4.8 m.

Always identify the hypotenuse first. When looking for it, you add the squares. When looking for a leg, you subtract.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What is the sum of the angles in any triangle?

    The angles of a triangle in a plane always add up to 180 degrees.
  2. 2. Legs of 9 and 12. What is the hypotenuse?

    81 + 144 = 225 and the square root of 225 is 15.
  3. 3. Which set of sides forms a right triangle?

    81 + 144 = 225 = 15 squared.
  4. 4. In a right triangle, which side is the longest?

    The hypotenuse faces the largest angle (90 degrees), so it is the longest side.

Summary

  • Triangle angles add up to 180°; in a right triangle the two acute angles add to 90°.
  • The hypotenuse is opposite the right angle and is the longest side.
  • Pythagoras: a² + b² = c² for right triangles.
  • The converse lets you test whether a triangle is right, acute, or obtuse.

Next: Similar Triangles and Ratios