Geometry · Pythagorean theorem

Pythagorean theorem

In a right triangle the squares on the two legs add up to the square on the hypotenuse: a² + b² = c². Off the right angle they differ by 2ab·cos C.

01

The Pythagorean theorem in this visualization

The Pythagorean theorem (Pythagoras’ theorem; in Chinese also the Gougu theorem) says that in a triangle with a right angle at CC, the legs aa and bb and the hypotenuse cc satisfy a2+b2=c2a^2 + b^2 = c^2: the squares on the legs together have the area of the square on the hypotenuse. The converse holds too — a triangle with a2+b2=c2a^2 + b^2 = c^2 has a right angle at CC. The page draws Euclid’s figure (Elements I.47) and lets CC leave the right angle, which turns the theorem into the law of cosines.

The pieces the altitudes cut, and the law of cosines
a2=cacos⁡B+abcos⁡C,b2=bccos⁡A+abcos⁡C,c2=bccos⁡A+cacos⁡Ba2+b2−c2=2abcos⁡C\begin{gathered} a^2 = ca\cos B + ab\cos C, \quad b^2 = bc\cos A + ab\cos C, \quad c^2 = bc\cos A + ca\cos B \\ a^2 + b^2 - c^2 = 2ab\cos C \end{gathered}

Each altitude, carried on through the square on the opposite side, cuts that square into two rectangles. The rectangle next to a vertex has area (the two sides meeting there) × the cosine of the angle there, and the two rectangles next to the same vertex — one in each square that meets there — are equal: hatched next to AA, dotted next to BB, yellow next to CC. Adding the three squares’ pieces gives the law of cosines. At a right angle at CC the yellow pieces vanish and the altitude from CC cuts the square on cc into exactly a2a^2 and b2b^2. Off the right angle the yellow pieces are the difference, each abcos⁡Cab\cos C: positive when CC is acute, negative when it is obtuse. Any piece is negative, and drawn outside its square, exactly when the angle at its vertex is obtuse; the other piece of that square is then larger than the square.

The three proofs answer three questions. Shear (Euclid) moves the piece of a2a^2 next to BB into the square on cc: a shear keeps base and height, a quarter turn keeps everything, so every frame keeps the area; off 90° only that piece moves and the yellow ones stay behind. Dissection (Zhao Shuang’s figure, 3rd century) fills c2c^2 with four copies of the triangle and a square of side ∣b−a∣|b - a|, 4⋅12ab+(b−a)2=a2+b24\cdot\tfrac12 ab + (b-a)^2 = a^2 + b^2, and turns two copies about corners to fill a2a^2 and b2b^2. Similar splits the triangle along its altitude into two copies of itself on aa and bb; similar figures’ areas scale with the square of a side, so semicircles, equilateral triangles or the triangle itself on the three sides add up just as the squares do.

02

Things to notice

  • The equation needs the right angle, and cc is the side opposite it. Put the right angle at AA and the pieces next to AA vanish instead: b2+c2=a2b^2 + c^2 = a^2. Lengths do not add: 3 + 4 is not 5.
  • A piece can be larger than its square or negative: with C=30∘C = 30^\circ, a=3a = 3, b=4b = 4 the pieces at CC are 63≈10.396\sqrt3 \approx 10.39, more than a2=9a^2 = 9, and the piece at the obtuse BB is 9−63≈−1.399 - 6\sqrt3 \approx -1.39, drawn outside and dashed.
  • The readouts say “= 0” and draw a right-angle mark only when the right angle is exact — set on the knob’s detent, typed, or caught while dragging CC. A triangle dragged close to it shows “≈ 0.01”: nearly right is not right.
03

Controls

  • Drag C: AA, BB and the square on cc stay, and CC catches on the circle on diameter ABAB (a right angle at CC) and on the lines through AA and BB perpendicular to ABAB. The knob turns ∠C\angle C with aa, bb kept; the wheels change aa, bb with ∠C\angle C kept. Type a side as 3, √2 or 1/3, the angle as 60° or π/3. Zhao’s figure and the similar triangles need a right angle: the page moves CC to 90° first and leaves the old triangle as a ghost you can go back to.
  • Presentation mode opens a full-screen view for projectors: Space proves, ← → step ∠C through the special angles, H hides every answer. Share copies a link to the current triangle, shape and proof.
04

Related

The distance between two points, Δx2+Δy2\sqrt{\Delta x^2 + \Delta y^2}, and sin⁡2θ+cos⁡2θ=1\sin^2\theta + \cos^2\theta = 1 on the unit circle are this theorem; the circle on diameter ABAB is where every angle ACBACB is right (Thales, the inscribed angle theorem).

Further reading: Wikipedia: Pythagorean theorem; Wikipedia: Law of cosines; MacTutor History of Mathematics: Euclid of Alexandria.