Geometric applications of the scalar product
Al-Kashi’s theorem
Generalising the Pythagorean Theorem to all triangles
The Pythagorean Theorem applies only to right-angled triangles. Al-Kashi’s theorem (also known as the law of cosines) generalises it to any triangle, using the dot product.
In a triangle ABC, where a = BC, b = AC, c = AB and A is the angle at A:
a² = b² + c² - 2bc cos(A)
Where does this formula come from?
We start from BC = AC – AB, so BC² = AC² + AB² – 2 × AC · AB. Since AC · AB = AC × AB × cos(A), we obtain exactly the formula above. This is a direct application of the expansion of ||u–v||² covered in the previous chapter.
Numerical example
Triangle ABC has AB = 6, AC = 8 and an angle at A of 60 degrees. Let’s calculate BC:
BC² = 6² + 8² - 2 × 6 × 8 × cos(60) = 36 + 64 - 96 × 0.5 = 100 - 48 = 52
BC = √52, which is approximately 7.2.
When to use Al-Kashi’s formula?
| Known data | What can be found |
|---|---|
| 2 sides + an included angle | The third side |
| 3 sides | An angle (by isolating cos) |
To find an angle from the three sides, isolate the cosine: cos(A) = (b² + c² - a²) / (2bc), then use the arccos function.
Common pitfall
If the triangle is right-angled at A, cos(A) = cos(90) = 0 and the formula yields exactly the Pythagorean theorem: a² = b² + c². The Pythagorean theorem is therefore a special case of Al-Kashi’s formula, not a competing formula.

