Law of Cosines Calculator

Published on: February 9, 2025
Final Answer: Free Full Steps: Plus

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:

\(c^{2} = a^{2} + b^{2} - 2ab\cos(C)\)
\(\cos(C) = \frac{a^{2} + b^{2} - c^{2}}{2ab}\)

Example 1:

\(\text{SAS: } a = 5,\; b = 7,\; C = 60^{\circ}\)

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

In this problem: The given values are \(a = 5\), \(b = 7\), and \(C = 60^{\circ}\). The missing value is side \(c\).

\(a = 5,\; b = 7,\; C = 60^{\circ}\)

Step 2 - Write the correct Law of Cosines formula.

In this problem: Use the Law of Cosines: \(c^{2} = a^{2} + b^{2} - 2ab\cos(C)\).

\(c^{2} = a^{2} + b^{2} - 2ab\cos(C)\)

Step 3 - Substitute the values.

In this problem: Substitute: \(c^{2} = 5^{2} + 7^{2} - 2 \times 5 \times 7 \times \cos(60^{\circ}) = 39\).

\(c^{2} = 5^{2} + 7^{2} - 2 \times 5 \times 7 \times \cos(60^{\circ}) = 39\)

Step 4 - Solve for the missing side or angle.

In this problem: Take the square root: \(c = \sqrt{39} \approx 6.24\).

\(c = \sqrt{39} \approx 6.24\)

Final answer:

\(c \approx 6.24\)

Example 2:

\(\text{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\), and \(c = 9\). The missing value is angle \(C\).

\(a = 7,\; b = 8,\; c = 9\)

Step 2 - Write the correct Law of Cosines formula.

In this problem: Use the Law of Cosines: \(\cos(C) = \frac{a^{2} + b^{2} - c^{2}}{2ab}\).

\(\cos(C) = \frac{a^{2} + b^{2} - c^{2}}{2ab}\)

Step 3 - Substitute the values.

In this problem: Substitute: \(\cos(C) = \frac{7^{2} + 8^{2} - 9^{2}}{2 \times 7 \times 8} = \frac{32}{112} \approx 0.29\).

\(\cos(C) = \frac{32}{112} \approx 0.29\)

Step 4 - Solve for the missing side or angle.

In this problem: Take arccos: \(C = \cos^{-1}(0.29) \approx 73.3985^{\circ}\).

\(C = \cos^{-1}(0.29) \approx 73.3985^{\circ}\)

Final answer:

\(C \approx 73.3985^{\circ}\)
See Example 1 Hide Example 1

Problem

\(\text{SAS: } a = 5,\; b = 7,\; C = 60^{\circ}\)

Approach

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.

Step 1

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

In this problem: The given values are \(a = 5\), \(b = 7\), and \(C = 60^{\circ}\). The missing value is side \(c\).

\(a = 5,\; b = 7,\; C = 60^{\circ}\)

Step 2

Step 2 - Write the correct Law of Cosines formula.

In this problem: Use the Law of Cosines: \(c^{2} = a^{2} + b^{2} - 2ab\cos(C)\).

\(c^{2} = a^{2} + b^{2} - 2ab\cos(C)\)

Step 3

Step 3 - Substitute the values.

In this problem: Substitute: \(c^{2} = 5^{2} + 7^{2} - 2 \times 5 \times 7 \times \cos(60^{\circ}) = 39\).

\(c^{2} = 5^{2} + 7^{2} - 2 \times 5 \times 7 \times \cos(60^{\circ}) = 39\)

Step 4

Step 4 - Solve for the missing side or angle.

In this problem: Take the square root: \(c = \sqrt{39} \approx 6.24\).

\(c = \sqrt{39} \approx 6.24\)

Final Answer

\(\text{SAS: } a = 5,\; b = 7,\; C = 60^{\circ} = c \approx 6.24\)
See Example 2 Hide Example 2

Problem

\(\text{SSS: } a = 7,\; b = 8,\; c = 9\)

Approach

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.

Step 1

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

In this problem: The given values are \(a = 7\), \(b = 8\), and \(c = 9\). The missing value is angle \(C\).

\(a = 7,\; b = 8,\; c = 9\)

Step 2

Step 2 - Write the correct Law of Cosines formula.

In this problem: Use the Law of Cosines: \(\cos(C) = \frac{a^{2} + b^{2} - c^{2}}{2ab}\).

\(\cos(C) = \frac{a^{2} + b^{2} - c^{2}}{2ab}\)

Step 3

Step 3 - Substitute the values.

In this problem: Substitute: \(\cos(C) = \frac{7^{2} + 8^{2} - 9^{2}}{2 \times 7 \times 8} = \frac{32}{112} \approx 0.29\).

\(\cos(C) = \frac{32}{112} \approx 0.29\)

Step 4

Step 4 - Solve for the missing side or angle.

In this problem: Take arccos: \(C = \cos^{-1}(0.29) \approx 73.3985^{\circ}\).

\(C = \cos^{-1}(0.29) \approx 73.3985^{\circ}\)

Final Answer

\(\text{SSS: } a = 7,\; b = 8,\; c = 9 = C \approx 73.3985^{\circ}\)