Law of Cosines: Finding an Angle from Three Sides

April 12, 2026

Problem

Find angle C in a triangle with sides a = 7, b = 9, c = 12.

Explanation

The Law of Cosines is a generalization of the Pythagorean theorem to any triangle, not just right ones. It relates the three sides to one of the angles:

c2=a2+b2−2abcos⁡Cc^{2} = a^{2} + b^{2} - 2ab\cos C

When C=90°C = 90°, cos⁡C=0\cos C = 0 and we recover c2=a2+b2c^{2} = a^{2} + b^{2} — the Pythagorean theorem. For other angles, the cos⁡C\cos C term either subtracts (if C<90°C < 90°, the triangle is "thinner") or adds (if C>90°C > 90°, the triangle is "fatter") to the right-angled value.

To solve for an angle given three sides, just rearrange:

cos⁡C=a2+b2−c22ab\cos C = \dfrac{a^{2} + b^{2} - c^{2}}{2ab}

Step-by-Step Solution

Given: a=7a = 7, b=9b = 9, c=12c = 12.

Find: Angle CC (the angle opposite side cc).


Step 1 — Square each side.

a2=49b2=81c2=144a^{2} = 49 \qquad b^{2} = 81 \qquad c^{2} = 144

Step 2 — Plug into the rearranged law.

cos⁡C=a2+b2−c22ab\cos C = \dfrac{a^{2} + b^{2} - c^{2}}{2ab}

=49+81−1442(7)(9)= \dfrac{49 + 81 - 144}{2(7)(9)}

=−14126= \dfrac{-14}{126}

≈−0.1111\approx -0.1111

Step 3 — Take the inverse cosine.

C=arccos⁡(−0.1111)≈96.38°C = \arccos(-0.1111) \approx 96.38°

(In radians: C≈1.682C \approx 1.682 rad.)

The negative cosine tells us the angle is obtuse (C>90°C > 90°). The triangle is "fat" — side cc is longer than what a right triangle with legs 7 and 9 would produce (49+81=130≈11.40\sqrt{49 + 81} = \sqrt{130} \approx 11.40, less than 12).

Step 4 — Find angles AA and BB for completeness.

Using the Law of Cosines for AA:

cos⁡A=b2+c2−a22bc=81+144−492(9)(12)=176216≈0.8148\cos A = \dfrac{b^{2} + c^{2} - a^{2}}{2bc} = \dfrac{81 + 144 - 49}{2(9)(12)} = \dfrac{176}{216} \approx 0.8148

A=arccos⁡(0.8148)≈35.43°A = \arccos(0.8148) \approx 35.43°

Using A+B+C=180°A + B + C = 180°:

B=180°−35.43°−96.38°≈48.19°B = 180° - 35.43° - 96.38° \approx 48.19°

Step 5 — Verify with the Law of Sines.

Check that a/sin⁡A≈b/sin⁡B≈c/sin⁡Ca/\sin A \approx b/\sin B \approx c/\sin C:

7sin⁡35.43°=70.5798≈12.072\dfrac{7}{\sin 35.43°} = \dfrac{7}{0.5798} \approx 12.072

9sin⁡48.19°=90.7454≈12.075\dfrac{9}{\sin 48.19°} = \dfrac{9}{0.7454} \approx 12.075

12sin⁡96.38°=120.9938≈12.075\dfrac{12}{\sin 96.38°} = \dfrac{12}{0.9938} \approx 12.075

All within rounding error. ✓


Answer:

  C=arccos⁡(−1/9)≈96.38°  \boxed{\;C = \arccos(-1/9) \approx 96.38°\;}

The triangle has angles approximately 35.43°, 48.19°, 96.38°35.43°,\, 48.19°,\, 96.38°. Since C>90°C > 90°, the triangle is obtuse at vertex CC — confirmed visually by the wide angle in the visualization.

Try It

  • Adjust the three sides with the sliders (subject to the triangle inequality ∣b−a∣<c<a+b|b - a| < c < a + b).
  • The triangle redraws in real time and the angles update.
  • The HUD shows the Law of Cosines computation step by step.
  • Try setting a2+b2=c2a^{2} + b^{2} = c^{2} (e.g. a=3a = 3, b=4b = 4, c=5c = 5) — angle CC should jump to exactly 90°.

Interactive Visualization

Parameters

7.00
9.00
12.00
Your turn

Got your own math or physics problem?

Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.

Sign Up Free to Try It30 free visualizations every day
Law of Cosines: Finding an Angle from Three Sides | MathSpin