Law of Cosines Calculator

Published on: February 9, 2025

This Law of Cosines Calculator helps you find a missing side or angle in a triangle when three related values are known. It can use two sides and the included angle to find a missing side, or three sides to find a missing angle using the law of cosines. Choose the mode that matches your problem, enter the known values, and the calculator will work out the missing result. It is a simple way to check answers, understand the law of cosines, and practise basic trigonometry step by step.

Step-by-step method

  1. Identify what is given and what is missing.
  2. Write the correct Law of Cosines formula.
  3. Substitute the values.
  4. Solve for the missing side or angle.

Formulas:

Formula (SAS → side c)

c2=a2+b22abcos(C)

Formula (SSS → angle C)

cos(C)=
a2 + b2 − c2
2ab

Example 1: SAS: a = 5, b = 7, C = 60°

Step 1 - Identify what is given and what is missing.

In this problem: The given values are a = 5, b = 7, C = 60°.

a=5b=7C=60°

Step 2 - Write the correct Law of Cosines formula.

In this problem: Use the Law of Cosines: c² = a² + b² − 2ab cos(C).

c2=a2+b22abcos(C)

Step 3 - Substitute the values.

In this problem: Substitute: c² = 5² + 7² − 2×5×7×cos(60°) = 39.

c2=52+722×5×7×cos(60°)=39

Step 4 - Solve for the missing side or angle.

In this problem: Take the square root: c = √39 = 6.244998.

c=√39=6.244998

Final answer: c = 6.244998

Example 2: SSS: a = 7, b = 8, c = 9

Step 1 - Identify what is given and what is missing.

In this problem: The given values are a = 7, b = 8, c = 9.

a=7b=8c=9

Step 2 - Write the correct Law of Cosines formula.

In this problem: Use the Law of Cosines: cos(C) = (a² + b² − c²) / (2ab).

cos(C)=
a2 + b2 − c2
2ab

Step 3 - Substitute the values.

In this problem: Substitute: cos(C) = (7² + 8² − 9²) / (2×7×8) = 32 / 112 = 0.28571429.

cos(C)=
32
112
=0.28571429

Step 4 - Solve for the missing side or angle.

In this problem: Take arccos: C = arccos(0.28571429) = 73.3984504°.

C=arccos(0.28571429)=73.3984504°

Final answer: C = 73.3984504°