Law of sines and law of cosines
Anchor (Master): Ptolemy Almagest ~150 AD; al-Kashi 1427 Miftah al-Hisab; Nasir al-Din al-Tusi ~1250
Intuition [Beginner]
The law of sines connects the sides of a triangle to the sines of the opposite angles:
Long sides sit opposite large angles, and short sides opposite small angles. The ratio is the same for all three pairs.
The law of cosines generalises the Pythagorean theorem to non-right triangles:
When , and we recover . When , the side is shorter than the Pythagorean prediction. When , the side is longer.
Together, these two laws let you solve any triangle given three pieces of information (at least one must be a side).
Visual [Beginner]
A general triangle with sides , , and opposite angles , , labelled. An altitude from one vertex is drawn as a dashed line, showing how it decomposes the triangle for the proof.
The Pythagorean theorem is the special case where one angle equals . The laws of sines and cosines handle every other triangle.
Worked example [Beginner]
A triangle has sides , and angle . Find side .
By the law of cosines: .
So .
Now find angle using the law of sines: , so , giving .
Check your understanding [Beginner]
Formal definition [Intermediate+]
Theorem (Law of sines). In any triangle with sides opposite angles :
where is the circumradius (the radius of the circumscribed circle).
Theorem (Law of cosines). In any triangle with sides opposite angles :
Key theorem with proof [Intermediate+]
Theorem. Both the law of sines and the law of cosines hold for any triangle.
Proof of the law of cosines. Place the triangle in the coordinate plane with at the origin, side along the positive -axis, and angle opening from the -axis.
Then and . The squared length of side :
Proof of the law of sines. The area of the triangle is . Dividing each expression by :
Inverting gives the law of sines.
Bridge. The law of cosines generalises the Pythagorean theorem by measuring the "penalty" for non-right angles through the correction term ; the foundational reason this correction appears is the dot product identity . This pattern appears again in the spherical law of cosines where the correction becomes . The bridge is that both laws express the geometry of triangles in terms of the inner product — the law of sines via area, the law of cosines via the dot product.
Exercises [Intermediate+]
Advanced results [Master]
The spherical law of cosines. On a sphere of radius , for a spherical triangle with sides (measured as arc-lengths) and opposite angles :
Note the sign in the correction term (opposite to the planar law). This is the form needed for navigation on the Earth's surface.
The extended law of sines and the circumradius. The identity connects the side-angle ratios to the circumradius. This provides a method for computing from any triangle: where is the area.
Heron's formula. Combined with the law of cosines, the area formula yields Heron's formula:
where is the semi-perimeter. This is computable from the three side lengths alone, with no angles needed.
Synthesis. The law of sines and law of cosines are the two pillars of triangle geometry; the central insight is that the inner-product structure of Euclidean space determines all metric properties of triangles. This pattern appears again in higher dimensions where the Gram determinant generalises the law of cosines to simplices, and in spherical/hyperbolic geometry where the curvature modifies the correction term. The bridge is that these laws identify triangles as the simplest geometric objects whose properties are fully determined by the metric — they build toward the theory of distance geometry and the Cayley-Menger determinant.
Full proof set [Master]
Proposition (Spherical law of cosines). On a unit sphere, for a spherical triangle with sides and angle .
Proof sketch. Let be the centre of the sphere, and points on the sphere with . The side is the angle , and sides are the angles subtended at by the other arcs. Using the dot product of the position vectors of the two vertices adjacent to and the spherical distance formula yields the identity.
Connections [Master]
The Pythagorean theorem is the degenerate case of the law of cosines, where the correction term vanishes — this connects to the entire Euclidean geometry framework built on right triangles.
Trigonometric identities 00.07.02 provide the algebraic tools (especially the sum formulas and ) used in the proofs of both laws.
The ambiguous case (SSA) connects to the inverse sine function's non-uniqueness: has two solutions in for positive values less than , reflecting the two possible triangle configurations.
Bibliography [Master]
@book{stewart-precalculus,
author = {Stewart, James and Redlin, Lothar and Watson, Saleem},
title = {Precalculus: Mathematics for Calculus},
edition = {8},
publisher = {Cengage},
year = {2019}
}
@book{al-kashi-1427,
author = {al-Kashi, Jamshid},
title = {Miftah al-Hisab (Key to Arithmetic)},
year = {1427},
note = {Explicit statement of the law of cosines}
}
@book{tusi-quadrilateral,
author = {Nasir al-Din al-Tusi},
title = {Treatise on the Quadrilateral},
year = {c. 1250},
note = {Systematic plane and spherical trigonometry}
}
@book{apostol-calculus-v1,
author = {Apostol, Tom M.},
title = {Calculus},
volume = {1},
edition = {2},
publisher = {Wiley},
year = {1967}
}
Historical & philosophical context [Master]
The law of sines appears in the work of Nasir al-Din al-Tusi [al-Tusi ~1250], who gave a systematic treatment of both plane and spherical trigonometry. The law of cosines was stated explicitly by Jamshid al-Kashi in his 1427 text Miftah al-Hisab [al-Kashi 1427], though the result was known implicitly to Euclid (Book II Proposition 12-13 give the obtuse and acute cases without cosine notation).
Ptolemy's chord table in the Almagest effectively encoded the law of sines for astronomical calculations. The modern algebraic form emerged in the 16th-17th century with the adoption of the sine function notation.
These laws are among the most practically useful results in mathematics. Every GPS triangulation, every architectural calculation involving non-right angles, and every navigation problem on the Earth's surface uses them (in their spherical form).