What Is the Law of Cosines?
The Law of Cosines relates the lengths of the sides of any triangle to the cosine of one of its angles. This calculator finds the third side c when you know two sides (a and b) and the angle C between them (the included angle). It generalizes the Pythagorean theorem to non-right triangles.
How to Use It
Enter the two known side lengths (a and b) and the included angle C in degrees — that is the angle opposite the side you want to find. Press calculate to get side c and the intermediate value c². Any consistent unit of length works (cm, m, in, ft) since the formula is purely geometric.
The Formula Explained
The equation is $$c = \sqrt{a^{2} + b^{2} - 2ab\cdot\cos C}.$$ When \(C = 90\degree\), \(\cos C = 0\), the middle term vanishes, and the formula reduces to the Pythagorean theorem \(c = \sqrt{a^{2} + b^{2}}\). For acute angles \(\cos C\) is positive, shortening \(c\); for obtuse angles \(\cos C\) is negative, lengthening \(c\).
Worked Example
Suppose \(a = 8\), \(b = 11\), and \(C = 37.5\degree\). First compute \(\cos 37.5\degree \approx 0.793353\). Then $$c^{2} = 8^{2} + 11^{2} - 2\cdot 8\cdot 11\cdot 0.793353 = 64 + 121 - 139.630 = 45.370.$$ Taking the square root gives \(c \approx 6.7357\).
FAQ
Does the angle have to be in degrees? Yes — enter C in degrees; the calculator converts it to radians internally.
Which angle is C? C is the angle between sides a and b, located directly opposite the side c you are solving for.
What if C is exactly 90°? Then the calculation matches the Pythagorean theorem, \(c = \sqrt{a^{2} + b^{2}}\).