Opening your learning space
Starting the app …
Opening your learning space
Starting the app …
The law of cosines generalizes the Pythagorean theorem to arbitrary triangles without a right angle.
Free to browse · flashcards or a multiple-choice quiz · import from Essential
Formula
Sides in the same length unit · γ in degrees or radians
| Symbol | Meaning | Unit |
|---|---|---|
| a, b, c | Sides of the triangle | m, cm, etc. |
| Angle opposite side c | ° or rad |
c^{2} = a^{2} + b^{2} - 2ab \cdot \cos\gammaOriginal schematic by Quanta
Free with a Quanta account. Your download stays ready after registration.
Formulated geometrically in Euclid's Elements (Book II, Propositions 12 and 13), in its modern form since Arabic and early modern trigonometry. For °, and the law becomes the Pythagorean theorem. It solves the cases SAS (two sides and the included angle) and SSS (three sides); rearranged it gives .
Holds in every planar triangle, for each side with its opposite angle. For ° it reduces to the Pythagorean theorem.
Coordinates or a height decomposition plus Pythagoras yield the extra term.
Angle from three sides
SSS case: determine all angles this way.
Other sides
The law holds cyclically for each side with its opposite angle.
A triangle has , , . Compute γ.
.
°.
The minus shows γ is obtuse.
, , °: compute side a.
° = 34 − 30·0.643 ≈ 14.7, so .
Using an angle that is not opposite the required side.
Side and opposite angle belong together: c with γ, a with α.
Mishandling the term −2ab·cos γ for obtuse γ.
For °, cos γ is negative, the term becomes positive and c larger.
Calculator in the wrong angle mode.
Check ; 60° is not 60 rad.
Formula cluster
Law of cosines for , law of sines for ; Pythagoras as the limiting case.
, , : , so . With it would remain (Pythagoras).
Triangle calculation for SAS and SSS, surveying and navigation, adding forces in physics, distance calculation in geometry
Here is how to work through a typical Law of Cosines (c² = a² + b² − 2ab·cos γ) task step by step:
Task
A triangle has , , . Compute γ.
Solution path
.
°.
The minus shows γ is obtuse.
Task
, , °: compute side a.
Solution path
° = 34 − 30·0.643 ≈ 14.7, so .
Decide by the given pieces. The law of cosines is responsible when no complete side-opposite-angle pair is available: in the SAS case (two sides and the included angle, third side sought) and in the SSS case (three sides, angles sought). The law of sines, by contrast, always needs a pair of a side and its opposite angle and thus serves and SSA. Practical exam procedure: sketch, mark the given pieces, check whether a side-opposite-angle pair is complete. If yes: law of sines (shorter). If no: law of cosines. Often you combine both, for example first computing the third side from SAS with the law of cosines and then finding the remaining angles conveniently with the law of sines or the law of cosines again.
Solve c2 = a2 + b2 − 2ab·cos γ for cos γ: move and the cosine term to different sides, then cos γ = (a2 + b2 − c2)/(2ab), and of that. Example with , , : , so °. This works for every angle if you swap the roles cyclically: . A big advantage over the law of sines: arccos gives a unique result in the range 0° to 180°, there is no ambiguity. The sign directly tells you the angle type: positive cosine means acute, negative obtuse.
The law of cosines is the generalization of Pythagoras to arbitrary triangles: c2 = a2 + b2 − 2ab·cos γ. If you set °, , the correction term vanishes and remains, the classical Pythagoras. For acute angles something is subtracted, c is shorter than in the right-angled case; for obtuse angles something is effectively added, c is longer. The term −2ab·cos γ measures exactly how far the triangle deviates from the right angle. This view also serves as a mental plausibility check: if the included angle is obtuse, the computed opposite side must be longer than , otherwise something is wrong.
In a triangle all angles lie between 0° and 180°, and on this range the cosine is a unique, decreasing function: positive for acute angles (0° to 90°), zero at 90°, negative for obtuse angles (90° to 180°). So if rearranging the law of cosines yields a negative value like , you know immediately without a calculator: γ is obtuse, here °. That is a real information gain over the law of sines, where does not reveal whether ° or ≈ 116° is meant. Hence the recommendation: compute angles, especially the largest angle of a triangle (opposite the longest side), preferably with the law of cosines, where obtuseness is detected automatically.
In the SAS case: insert the two known sides and the INCLUDED angle and take the root at the end. Example: , and ° (note: α lies opposite the sought side a and between b and c). ° = 34 − 30·0.643 ≈ 14.7, so . Three checks pay off: first, the inserted angle must really lie between the two known sides (and thus opposite the sought side). Second, verify the calculator is in DEG mode. Third, triangle inequality as plausibility: a must lie between and , and 3.84 fits. Forgetting the final square root is the most banal yet most frequent error.
Quanta exam set
Curated exam set for "Law of Cosines":
Question (front)
Which formula describes Law of Cosines?
Answer in your set
Question (front)
How do you rearrange Law of Cosines for Angle from three sides?
Answer in your set
Question (front)
Which common mistake happens with Law of Cosines?
Answer in your set
+ 7 more cards: units, variables, derivation, example, exam task
The formula set contains 10 cards. After importing, review them and start practicing; your ratings determine later review intervals.
This list names subject references and further reading. A page or section number appears when it is part of the reference; these are not verbatim quotations.
Create a curated FSRS exam set for c² = a² + b² − 2ab·cos γ: formula recall, variables, derivation, rearrangement, worked example, common mistakes and exam context.
Curated formula set · LaTeX · FSRS spaced repetition · import from Essential