CompoundPage

Law of cosines calculator

Sides of 7 and 10 with 60° between them give a third side of 8.8882 in the law of cosines calculator, since c² = 49 + 100 - 70 = 79.

degrees

degreesFor ASA, AAS and SSA. In ASA the side between angles A and B is c; in AAS the side given is a; in SSA the sides are a and b.

degreesFor ASA and AAS.

Third side8.8882

Third side, by the law of cosines c² = a² + b² - 2ab cos C = 49 + 100 - 2 × 7 × 10 × cos 60° = 79, so c = 8.8882.
8.8882
Sides
a = 7, b = 10, c = 8.8882
Angles Summing to 180 degrees, as every plane triangle must.
A = 43deg, B = 77deg, C = 60deg
Area
30.3109
Perimeter
25.8882
Type
scalene, acute
Heights The perpendicular from each side to the opposite vertex. Area is half the base times the height for any of the three.
to a: 8.6603, to b: 6.0622, to c: 6.8205
Circumradius The radius of the circle through all three vertices.
5.1316
Inradius The radius of the largest circle that fits inside.
2.3417
Common Pythagorean triples
abcMultiples
3456-8-10, 9-12-15, 30-40-50
5121310-24-26, 15-36-39
8151716-30-34
7242514-48-50
20212940-42-58
9404118-80-82
  • The Pythagorean theorem holds only for right triangles. For any other triangle the law of cosines generalizes it: c squared equals a squared plus b squared minus 2ab cos(C), which reduces to Pythagoras when C is 90 degrees and cos(C) is zero.
  • Any two sides must add to more than the third, or the shape does not close. That triangle inequality is checked here before anything else is computed.

How the Triangle Calculator works

The law of cosines relates all three sides of any triangle to one of its angles: c² = a² + b² - 2ab cos C, where C is the angle between sides a and b, opposite side c. It solves the two cases the law of sines cannot start from: two sides and the angle between them, and three sides.

For a = 7, b = 10 and C = 60°: cos 60° = 0.5, so c² = 49 + 100 - 2 × 7 × 10 × 0.5 = 149 - 70 = 79, and c = √79 = 8.8882.

Rearranged, it gives an angle from three sides: cos A = (b² + c² - a²) ÷ 2bc. Here cos A = (100 + 79 - 49) ÷ (2 × 10 × 8.8882) = 130 ÷ 177.76 = 0.7313, so A = 43.0°, and B = 180° - 60° - 43.0° = 77.0°.

When C is 90°, cos C is 0 and the last term disappears, which leaves the Pythagorean theorem. An angle over 90° has a negative cosine, so the third side comes out longer than Pythagoras would give; an angle under 90° makes it shorter.

The area follows from the same two sides and angle: ½ab sin C = ½ × 7 × 10 × sin 60° = 30.31.

Triangle Calculator FAQ

When do I use the law of cosines instead of the law of sines?

When you know two sides and the angle between them, or all three sides. The law of sines needs an angle and the side opposite it, which neither case gives you.

What is the law of cosines for angle A?

a² = b² + c² - 2bc cos A, or, solved for the angle, A = arccos((b² + c² - a²) ÷ 2bc). The formula is the same for each angle with the letters rotated.

Does it work when the angle is obtuse?

Yes. With sides 7 and 10 and 120° between them, cos 120° = -0.5, so c² = 149 + 70 = 219 and c = 14.80.

More from the Triangle Calculator

Related calculators

Embed this calculator
<div id="compoundpage-triangle-calculator"></div>
<script src="https://compoundpage.com/embed/triangle-calculator.js" async></script>

The same calculation as JSON