Law of sines and law of cosines
Anchor (Master): Ptolemy ~150 Almagest; al-Biruni ~1000; Regiomontanus 1464 De triangulis omnimodis
Intuition [Beginner]
Right-triangle trigonometry solves triangles that contain a 90-degree angle. But most triangles in nature — a plot of land, a bridge truss, a navigation course — have no right angle. We need tools that work on any triangle.
The law of sines and the law of cosines are those tools. Given three pieces of information about a triangle (at least one of them a side), they recover the remaining sides and angles. The law of sines works when you know an angle and its opposite side. The law of cosines works when you know two sides and the angle between them, or all three sides.
Together, these two laws solve every solvable triangle. They are the generalisation of SOH-CAH-TOA from right triangles to all triangles.
Visual [Beginner]
A scalene triangle with sides , , and angles , , opposite each side. The triangle has no right angle, no equal sides, no special symmetry — a generic triangle that the right-triangle tools cannot handle directly.
The altitude from one vertex creates two right triangles inside the original triangle. Each right triangle can be analysed with the basic trig ratios, and the results combine to give the law of sines and law of cosines.
Worked example [Beginner]
A triangle has sides , and the angle between them. Find the third side .
Step 1. Use the law of cosines: .
Step 2. Substitute: .
Step 3. Take the square root: .
What this tells us: the law of cosines generalises the Pythagorean theorem. When , the cosine term vanishes and .
Check your understanding [Beginner]
Formal definition [Intermediate+]
Let a triangle have vertices , , with opposite sides , , respectively.
Definition (law of sines). In any triangle:
Definition (law of cosines). In any triangle:
By symmetry, the law of cosines also reads and .
Triangle-solving cases. Given three of the six quantities (with at least one side), the triangle is determined (with exceptions noted below):
- ASA (two angles and the included side): use the law of sines. Find the third angle via , then find the remaining sides.
- SAS (two sides and the included angle): use the law of cosines to find the third side, then the law of sines or cosines for the remaining angles.
- SSS (three sides): use the law of cosines to find each angle.
- SSA (two sides and a non-included angle): the ambiguous case. Zero, one, or two triangles may satisfy the given data, depending on the relative sizes.
Counterexamples to common slips
- SSA does not always determine a unique triangle. Given , , : , so or . Both produce valid triangles. This is the ambiguous case.
- The law of sines gives two possible angles. Since , solving yields or . Both must be checked against the angle-sum constraint .
- Angle-side correspondence matters. Side is opposite angle ; mixing up this pairing produces incorrect results.
Key theorem with proof [Intermediate+]
Theorem (law of cosines). In any triangle with sides , , and angle opposite side :
Proof. Place the triangle in the coordinate plane with at the origin, side along the positive -axis, and side making angle with the -axis. Then vertex is at and vertex is at . The distance from to is , so:
Since :
Bridge. The foundational reason the law of cosines is the correct generalisation of the Pythagorean theorem is that the term encodes the deviation from orthogonality: when , the cosine vanishes and the Pythagorean relation is recovered. This is exactly the content that identifies the dot product with the cosine of the included angle, and the bridge is between the purely geometric triangle-solving problem and the algebraic structure of the Euclidean inner product. The central insight is that every triangle-solver is an application of coordinates and distance, and putting these together, the law of cosines generalises from the plane to higher-dimensional Euclidean spaces where the same formula holds for any triangle embedded in . This pattern builds toward 00.09.01 where the distance formula in Cartesian coordinates provides the general framework, and appears again in 00.06.02 where inverse trigonometric functions extract the angle from the law of cosines.
Exercises [Intermediate+]
Advanced results [Master]
Theorem 1 (extended law of sines). In any triangle with circumradius :
Equivalently, . The law of sines is the assertion that all three ratios equal the diameter of the circumscribed circle.
Theorem 2 (area formulas). The area of a triangle can be expressed as:
where is the circumradius, is the inradius, and is the semi-perimeter. The first formula follows from the altitude construction, the second from the extended law of sines, and the third is Heron's formula.
Theorem 3 (Mollweide's formulas). For any triangle:
These identities involve all six elements of the triangle simultaneously and serve as consistency checks on computed solutions.
Theorem 4 (law of cosines in vector form). For vectors and in :
where is the angle between and . This is the law of cosines in disguise: the dot product encodes the same cosine relation.
Theorem 5 (spherical law of cosines). On a unit sphere, for a spherical triangle with sides , , (arc lengths) and angle opposite side :
The sign change from to reflects the positive curvature of the sphere. This formula is foundational in spherical astronomy and navigation.
Theorem 6 (half-angle formulas via the inscribed circle). The half-angle formulas express , , and in terms of the sides and semi-perimeter:
These are used extensively in surveying and geodesy, where the tangent half-angle formula avoids the ambiguity of .
Synthesis. The foundational reason the law of sines and law of cosines solve every triangle is that the three ratios , , all equal the circumdiameter , and the central insight is that this common value ties the metric data (side lengths) to the angular data (angles) through the geometry of the circumscribed circle. This is exactly the content that identifies triangle-solving with the Euclidean distance formula, and the bridge is between the plane-triangle formulas and their vector formulation in , where the law of cosines becomes the algebraic identity . Putting these together, the law of cosines generalises from the Euclidean plane to the sphere (where the sign of the curvature term flips) and to hyperbolic geometry, and this pattern recurs in the cosine rule for sides of a tetrahedron and in the law of cosines for simplices in . The extended law of sines builds toward 00.09.01 where the Cartesian coordinate system makes the vector form of the law of cosines the load-bearing identity, and the spherical law of cosines appears again in 00.07.01 where the unit-circle framework provides the trigonometric functions used on the sphere.
Full proof set [Master]
Proposition 1 (law of sines). In any triangle, .
Proof. Drop the altitude from vertex to side (or its extension). In the two right triangles formed, . Therefore . By dropping the altitude from a different vertex, the same argument gives .
Proposition 2 (extended law of sines: ). In any triangle with circumradius , .
Proof. Let be the circumcenter and the circumradius. Draw the diameter through and let be the opposite endpoint on the circumcircle, so . The angle is a right angle (Thales' theorem: the angle subtended by a diameter is a right angle). In triangle , the side and the angle at is (inscribed angles subtending the same arc are equal). Therefore in triangle , giving . The same construction with the diameter through a different vertex gives .
Proposition 3 (Heron's formula). .
Proof. From and , the law of cosines gives . Then . Factor as difference of squares: . Each factor simplifies: , , , . So .
Connections [Master]
Right-triangle trigonometry
00.06.01. The law of sines and law of cosines are the direct generalisations of the right-triangle trigonometric ratios from00.06.01. When the triangle contains a right angle, the law of sines reduces to (the basic right-triangle definition), and the law of cosines reduces to the Pythagorean theorem. Every right-triangle result is a special case of the oblique-triangle laws.Inverse trigonometric functions
00.06.02. The SSS case of triangle-solving requires extracting angles from the law of cosines using , and the SSA ambiguous case requires with its dual-solution property. The inverse trigonometric functions from00.06.02are the computational tools that make the law of sines and law of cosines into a complete triangle-solving system.Cartesian coordinates and distance
00.09.01. The proof of the law of cosines given in this unit places the triangle in the coordinate plane and uses the distance formula, which is the Pythagorean theorem in coordinates. The connection to00.09.01is that the law of cosines in vector form is the natural generalisation of the squared-distance formula to non-axis-aligned vectors.
Historical & philosophical context [Master]
Ptolemy 150 CE Almagest [Ptolemy150] solved triangles using the chord function and the chord addition formula, which is equivalent to the law of cosines for chords. The law of sines in its modern form first appeared in the work of al-Biruni ~1000 [alBiruni1000] in his Kitab maqalid ilm al-hay'a (Book of the Keys to Astronomy), where he applied it to problems in spherical astronomy. The systematic treatment of plane-triangle solving is due to Regiomontanus 1464 De triangulis omnimodis [Regiomontanus1464], the first European textbook devoted entirely to trigonometry, which classified all triangle-solving cases (ASA, SAS, SSS, SSA) and gave complete solutions for each. Heron's formula for the area of a triangle from its sides appears in Heron of Alexandria's Metrica (60 CE), though the derivation given there is attributed to Archimedes. The spherical law of cosines was developed by al-Battani ~900 and systematised by Napier in the early 17th century for use in navigation.
Bibliography [Master]
@book{Ptolemy150,
author = {Ptolemy, Claudius},
title = {Mathematike Syntaxis (Almagest)},
year = {~150 CE}
}
@book{alBiruni1000,
author = {al-Biruni, Abu Rayhan},
title = {Kitab maqalid ilm al-hay'a (Book of the Keys to Astronomy)},
year = {~1000}
}
@book{Regiomontanus1464,
author = {Regiomontanus, Johannes},
title = {De triangulis omnimodis},
year = {1464}
}
@book{Heron60,
author = {Heron of Alexandria},
title = {Metrica},
year = {~60 CE}
}
@book{Lang1988,
author = {Lang, Serge},
title = {Basic Mathematics},
publisher = {Springer},
year = {1988}
}