Cosine Formula Usage Explained

Interactive Cosine Formula Usage Explained graph — click to explore
Click the graph to explore it interactively →
Question: What is the cosine formula and when do I use it?

What is the Cosine Formula?

The Cosine Formula (also known as the Law of Cosines) relates the lengths of the three sides of any triangle to the cosine of one of its angles. It is a powerful generalization of the Pythagorean Theorem that works for all triangles, not just right-angled ones.
For any triangle \triangle ABC with side lengths a, b, c opposite to angles A, B, C respectively:
c^2 = a^2 + b^2 - 2ab \cos(C)
Similarly, for the other two sides: \begin{align*} a^2 &= b^2 + c^2 - 2bc \cos(A) \\ b^2 &= a^2 + c^2 - 2ac \cos(B) \end{align*}

Rearranged Form (Finding an Angle)

When you need to find an unknown angle given all three sides, rearrange the formula:
\cos(C) = \frac{a^2 + b^2 - c^2}{2ab}
\begin{align*} \cos(A) &= \frac{b^2 + c^2 - a^2}{2bc} \\ \cos(B) &= \frac{a^2 + c^2 - b^2}{2ac} \end{align*}

When Do You Use It?

You use the Cosine Formula in two specific scenarios:

1. SAS (Side-Angle-Side) — Find the Missing Side

  • Given: Two sides and the included angle (the angle between them).
  • Goal: Find the third side opposite the given angle.
  • Example: If you know side a, side b, and angle C, use:
c = \sqrt{a^2 + b^2 - 2ab \cos(C)}

2. SSS (Side-Side-Side) — Find Any Angle

  • Given: All three side lengths ( a, b, and c).
  • Goal: Find any of the three interior angles.
  • Example: To find angle C, use:
C = \arccos\left(\frac{a^2 + b^2 - c^2}{2ab}\right)

Connection to the Pythagorean Theorem

Notice what happens when the angle C = 90^\circ: \cos(90^\circ) = 0
The formula simplifies to: c^2 = a^2 + b^2 - 2ab(0) \implies c^2 = a^2 + b^2
  • If C < 90^\circ (acute angle), \cos(C) > 0, so c^2 < a^2 + b^2.
  • If C > 90^\circ (obtuse angle), \cos(C) < 0, so c^2 > a^2 + b^2.

Interactive Diagram Guide

In the accompanying diagram:
  • Triangle \triangle ABC is displayed with vertices A, B, and C.
  • Sides are color-coded: side a (opposite A), side b (opposite B), and side c (opposite C).
  • You can adjust the slider for angle C to see how the length of the opposite side c changes dynamically, confirming the formula c^2 = a^2 + b^2 - 2ab\cos(C).