Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Side c (opposite angle C)
6.245
length units
c² (a² + b² − 2ab·cos C) 39

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\).

Advertisement
Triangle with sides a, b, c and angle C between sides a and b
The Law of Cosines finds side c opposite the included angle C, between sides a and b.

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\).

Triangle with example values a=5, b=7, included angle C=60 degrees, solving for side c
Worked example: with a = 5, b = 7 and C = 60°, side c works out to about 6.24.

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}}\).

Last updated: