All articles
GeneralExposition

The Law of Cosines

A moving tessellation turns Pythagoras into the cosine rule, with overlaps for acute triangles and gaps for obtuse ones.

GeometryTessellationsInteractive

The Pythagorean theorem is the right-angle member of a larger picture. If a triangle has sides aa, bb and cc, withCC the angle between the sides aa and bb, then

c2=a2+b22abcosCc^2=a^2+b^2-2ab\cos C

The extra term measures a failure of perpendicularity. In the tessellation below it appears twice: as two overlaps when CCis acute, as two gaps when CC is obtuse, and as two collapsed parallelograms when CC is right.

The space of triangle shapes

A triangle has three side lengths, but multiplying all of them by the same positive number does not change its shape. Removing this scale leaves two independent parameters. The moduli space of triangles up to similarity is therefore two-dimensional.

There is a symmetric way to see it. Normalize the perimeter and write x=aa+b+c, y=ba+b+c, z=ca+b+cx=\frac{a}{a+b+c},\ y=\frac{b}{a+b+c},\ z=\frac{c}{a+b+c}. Then x+y+z=1x+y+z=1. The triangle inequalities say precisely that 0<x,y,z<120<x,y,z<\tfrac12.

Thus labelled triangle shapes form the open central triangle inside the standard simplex. If the names of the sides do not matter, permutations of (x,y,z)(x,y,z) describe the same shape.

For the interactive it is more convenient to choose one chamber of that quotient. Order the sides so that 0<bac0<b\leq a\leq cand normalize the longest side to c=1c=1. Every unlabelled nondegenerate triangle then appears exactly once in the chamber

M={(a,b):0<ba1, a+b>1}\mathcal M_{\triangle}=\{(a,b):0<b\leq a\leq1,\ a+b>1\}

This is the triangular chamber in the first panel of the interactive. Its distinguished features are:

  • (1,1)(1,1) is the equilateral triangle;
  • a=ba=b and a=1a=1 are the two isosceles boundaries;
  • a+b=1a+b=1 is the degenerate limit;
  • a2+b2=1a^2+b^2=1 is the curve of right triangles.

The right-triangle curve divides the chamber into acute and obtuse regions:

a2+b2>1C<90,a2+b2=1C=90,a2+b2<1C>90.\begin{aligned}a^2+b^2&>1&&\Longleftrightarrow&&C<90^\circ,\\a^2+b^2&=1&&\Longleftrightarrow&&C=90^\circ,\\a^2+b^2&<1&&\Longleftrightarrow&&C>90^\circ.\end{aligned}

Explore the tessellation

c2=a2+b22abcosCc^2=a^2+b^2-2ab\cos C
Shape space

Triangles up to similarity

78.8°
rightdegenerate limitequilateral
Representative

The triangle and its squares

acute
C
Tessellation of the plane

Two square families, one moving grid

a² squaresb² squaresoverlap

The softly shaded parallelograms are overlaps: the two square families cover the same area twice.

Open the Law of Cosines investigation in the full Lab view ↗

How to use it

  1. Choose a triangle. Drag the gold point in the moduli chamber, or use the acute, right and obtuse presets. The representative triangle and all three side-squares change with it.
  2. Compare the two boxes. The blue a2a^2-square, yellow b2b^2-square and patterned c2c^2-square attached to the triangle are exact translated copies of the corresponding regions in the plane tessellation.
  3. Move the grid. Drag the gold anchor in the plane. This translates the black c2c^2-grid without rotating it. The cut lines copied into the side-squares move at the same time.
  4. Cross the right-triangle curve. For an acute triangle, blue and yellow overlap in green parallelograms. For an obtuse triangle, the same parallelograms become white gaps. At a right triangle they flatten into line segments.

Moving the anchor changes the dissection but not the area identity. It gives a continuous family of pictures for the same proof.

The vectors behind the picture

Place the two sides meeting at CC as vectors p\mathbf p and q\mathbf q: p=a, q=b, (p,q)=C|\mathbf p|=a,\ |\mathbf q|=b,\ \angle(\mathbf p,\mathbf q)=C.

The third side is the difference d=pq\mathbf d=\mathbf p-\mathbf q, so d=c|\mathbf d|=c. Let JJ denote rotation through 9090^\circ. The vectors d\mathbf d and JdJ\mathbf d are perpendicular and have equal length cc; they generate the black square grid in the interactive.

Now make two alternating broken lines using the steps p,q,p,q,\mathbf p,-\mathbf q,\mathbf p,-\mathbf q,\ldotsand, perpendicularly, Jp,Jq,Jp,Jq,J\mathbf p,-J\mathbf q,J\mathbf p,-J\mathbf q,\ldots. Every pair of horizontal-type steps has displacement pq=d\mathbf p-\mathbf q=\mathbf d, and every pair of rotated steps has displacement JdJ\mathbf d. The pattern therefore repeats with exactly the same periods as thec2c^2-grid.

Within one period there is one blue square generated byp\mathbf p and JpJ\mathbf p, hence of area a2a^2, and one yellow square generated byq\mathbf q and JqJ\mathbf q, hence of area b2b^2. Two congruent parallelograms complete the accounting.

The cosine parallelograms

One correction parallelogram is generated by p\mathbf p and JqJ\mathbf q. Its oriented area is

det(p,Jq)=pq=abcosC\det(\mathbf p,J\mathbf q)=\mathbf p\cdot\mathbf q=ab\cos C

Its ordinary area is therefore P=abcosCP=ab|\cos C|.

There are two such parallelograms in every c2c^2period. That is the geometric source of the coefficient 2 in the law of cosines.

Reading the proof from the tessellation

Acute triangles: two overlaps

When C<90C<90^\circ, we have cosC>0\cos C>0. The blue and yellow squares overlap in two green parallelograms, each of area P=abcosCP=ab\cos C.

One c2c^2 cell is covered by the blue and yellow squares, but each green region has been counted twice. Inclusion–exclusion gives

c2=a2+b2PP=a2+b22abcosC.\begin{aligned}c^2&=a^2+b^2-P-P\\&=a^2+b^2-2ab\cos C.\end{aligned}

Obtuse triangles: two gaps

When C>90C>90^\circ, we have cosC<0\cos C<0. The two square families no longer overlap. Instead they leave two congruent white parallelograms in each c2c^2 cell. Their area is P=abcosC=abcosCP=ab|\cos C|=-ab\cos C.

Now the whole cell consists of the two squares and the two gaps:

c2=a2+b2+P+P=a2+b22abcosC.\begin{aligned}c^2&=a^2+b^2+P+P\\&=a^2+b^2-2ab\cos C.\end{aligned}

Right triangles: the transition

When C=90C=90^\circ, the height of each correction parallelogram is zero. The gaps or overlaps disappear, and the picture becomes the Pythagorean tessellation: c2=a2+b2c^2=a^2+b^2.

The acute, right and obtuse diagrams are not three unrelated proofs. They are three regimes of one continuously varying construction.

At this right-angle slice, the correction regions vanish but the movable common-lattice dissection remains. Infinitely many “proofs” of Pythagoras’ theorem explores that slice in depth, including its medieval corner, Perigal and symmetric-twin anchor positions.

Why the anchor can move

The black grid can be translated without changing its orientation. Two anchors differing by an integer combination of d\mathbf d and JdJ\mathbf d produce the same relative overlay. For a fixed triangle, the genuine phase space of the anchor is therefore R2/(Zd+ZJd)\mathbb R^2/(\mathbb Z\mathbf d+\mathbb ZJ\mathbf d), a flat torus. The triangle shape supplies two parameters and the grid phase supplies two more. The full family explored by the interactive is consequently four-dimensional, even though the screen shows only one triangle and one draggable point at a time.

Continue

Where to continue

Reading preferences

Display settings

Choose a comfortable text size and page theme. Preferences are stored only on this device.

Text size
Theme

Medium text · Light theme

On this device