Law of Cosines: Finding an Angle from Three Sides
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:
When , and we recover — the Pythagorean theorem. For other angles, the term either subtracts (if , the triangle is "thinner") or adds (if , the triangle is "fatter") to the right-angled value.
To solve for an angle given three sides, just rearrange:
Step-by-Step Solution
Given: , , .
Find: Angle (the angle opposite side ).
Step 1 — Square each side.
Step 2 — Plug into the rearranged law.
Step 3 — Take the inverse cosine.
(In radians: rad.)
The negative cosine tells us the angle is obtuse (). The triangle is "fat" — side is longer than what a right triangle with legs 7 and 9 would produce (, less than 12).
Step 4 — Find angles and for completeness.
Using the Law of Cosines for :
Using :
Step 5 — Verify with the Law of Sines.
Check that :
All within rounding error. ✓
Answer:
The triangle has angles approximately . Since , the triangle is obtuse at vertex — confirmed visually by the wide angle in the visualization.
Try It
- Adjust the three sides with the sliders (subject to the triangle inequality ).
- The triangle redraws in real time and the angles update.
- The HUD shows the Law of Cosines computation step by step.
- Try setting (e.g. , , ) — angle should jump to exactly 90°.
Interactive Visualization
Parameters
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.