Solve any triangle side or angle with the law of cosines
Solve For
SAS — Two sides and the included angle are known. Finds the third side and all angles.
Known Values
Angle C is the angle between sides a and b.
Examples
Results
Full Triangle
Formula Reference
Given sides a, b and included angle C, find side c:
Then find remaining angles using the law of cosines again:
The law of cosines generalises the Pythagorean theorem: when C = 90°, cos(C) = 0 and the formula reduces to c² = a² + b².
The law of cosines calculator instantly solves any triangle when you know two sides and the included angle (SAS) or all three sides (SSS). It applies the cosine rule — c² = a² + b² − 2ab·cos(C) — to find every unknown side and angle, plus the triangle's area and perimeter, with full step-by-step formula display.
The law of cosines relates the three sides of a triangle to one of its angles: c² = a² + b² − 2ab·cos(C). It generalises the Pythagorean theorem — when C is 90°, cos(C) = 0 and the formula simplifies to c² = a² + b².
Use SAS (Side-Angle-Side) mode when you know two sides and the angle between them and need to find the third side. Use SSS mode when all three side lengths are already known and you need to find every interior angle.
Yes — the law of cosines works for all triangle types: acute, obtuse, and right-angled. It can solve SAS and SSS cases directly. For ASA or AAS cases the law of sines is typically more convenient, though both laws give the same result.
For a valid triangle, each side must be shorter than the sum of the other two. If this condition is violated — for example sides 1, 2, 10 — no real triangle can be formed and the calculator will show an error instead of a meaningless result.