The Law of Cosines generalises the Pythagorean theorem to any triangle, relating the square of one side to the sum of the squares of the other two sides minus twice their product times the cosine of the included angle. When the included angle is 90°, cos(90°) = 0 and the formula reduces to the Pythagorean theorem a² = b² + c². It is used to solve triangles when three sides (SSS) or two sides and the included angle (SAS) are known, and is fundamental in physics (vector addition), engineering, and 3D geometry.
c² = a² + b² − 2ab·cos(C)
LaTeX: c^2 = a^2 + b^2 - 2ab\cos(C)
| Symbol | Meaning | Unit |
|---|---|---|
| c | side opposite to angle C | length units |
| a | one of the two sides enclosing angle C | length units |
| b | the other side enclosing angle C | length units |
| C | the angle between sides a and b | degrees or radians |
Problem
Two ships leave a port. Ship A travels 30 km on a bearing of N60°E, and Ship B travels 40 km due East. Find the distance between the two ships.
Solution
Step 1: Let side a = 30 km (Ship A), side b = 40 km (Ship B). The angle between them: Ship A goes 60° from North (= 30° from East), Ship B goes East (= 0° from East). Angle C between paths = 30°. Step 2: c² = a² + b² − 2ab·cos(C) = 30² + 40² − 2(30)(40)cos(30°). Step 3: c² = 900 + 1600 − 2400 × 0.8660 = 2500 − 2078.5 = 421.5. Step 4: c = √421.5 ≈ 20.53 km.
Answer
The two ships are approximately 20.5 km apart.
| Known | Unknown | Formula Used | Application |
|---|---|---|---|
| a, b, C (SAS) | Side c | c² = a² + b² − 2ab·cos(C) | Most common SAS use |
| a, b, c (SSS) | Angle A | cos(A) = (b² + c² − a²) / (2bc) | Find any angle from 3 sides |
| a, b, c (SSS) | Angle B | cos(B) = (a² + c² − b²) / (2ac) | Find second angle |
| a, b, 90° (right Δ) | Hypotenuse c | c² = a² + b² | Reduces to Pythagoras |
| b, c, A (SAS) | Side a | a² = b² + c² − 2bc·cos(A) | Equivalent form |
Wikimedia Commons, CC BY-SA
The Law of Sines (also called the Sine Rule) states that in any triangle, the ratio of the length of each side to the sine of the opposite angle is the same constant, equal to the diameter of the triangle's circumscribed circle. This law applies to all triangles, not just right triangles, making it a powerful tool for solving oblique triangles when two angles and a side (AAS or ASA) or two sides and a non-included angle (SSA) are known. It is fundamental in surveying, navigation, and geodesy.
The cosine function is a fundamental trigonometric function defined as the ratio of the adjacent side to the hypotenuse in a right triangle, and extended to all real numbers as the x-coordinate of a point on the unit circle at angle θ from the positive x-axis. Like sine, it is periodic with period 2π and range [−1, 1], but is phase-shifted by π/2 relative to sine (cos θ = sin(θ + π/2)). Cosine is widely used in Fourier analysis, wave optics, mechanical vibrations, and calculating dot products of vectors.
The Pythagorean Theorem states that in any right triangle, the square of the length of the hypotenuse (the side opposite the right angle) equals the sum of the squares of the lengths of the other two sides (the legs). It is one of the most famous and widely applied theorems in mathematics, used in distance calculations, navigation, construction, and virtually every branch of science and engineering.
Known to Euclid as Proposition 12–13 of Book II of the Elements (c. 300 BC), though without trigonometric notation. The cosine formulation was developed by François Viète and others during the Renaissance. The name "Law of Cosines" became standard in 19th-century English textbooks; in French it is called théorème d'Al-Kashi, honouring Persian mathematician Jamshid al-Kashi (c. 1427 AD).