What Is the Law of Cosines?
The Law of Cosines is a triangle formula used to connect all three sides with one angle. It is especially useful for non-right triangles, where the Pythagorean theorem alone is not enough. If you know two sides and the included angle, you can find the third side. If you know all three sides, you can find any angle.
Law of Cosines Formulas
You’ll most commonly see these forms:
- c² = a² + b² − 2ab cos(C)
- a² = b² + c² − 2bc cos(A)
- b² = a² + c² − 2ac cos(B)
To solve an angle from three sides:
- cos(C) = (a² + b² − c²) / (2ab)
- C = arccos[(a² + b² − c²) / (2ab)]
How to Use This Calculator
1) Find an unknown side
Select Find side c, then enter side a, side b, and included angle C in degrees. Click Calculate and the tool returns side c.
2) Find an unknown angle
Select Find angle C, then enter sides a, b, and c. The calculator verifies whether a valid triangle exists and then computes angle C.
Worked Example (Find a Side)
Suppose a = 8, b = 11, and C = 42°. Plug into the formula:
c² = 8² + 11² − 2(8)(11)cos(42°)
c² = 64 + 121 − 176cos(42°) ≈ 54.24, so c ≈ 7.37.
Worked Example (Find an Angle)
Suppose a = 7, b = 9, c = 10:
cos(C) = (7² + 9² − 10²) / (2·7·9) = (49 + 81 − 100) / 126 = 30/126 ≈ 0.2381
C = arccos(0.2381) ≈ 76.23°
When to Use Law of Cosines vs. Law of Sines
- Use Law of Cosines for SAS (side-angle-side) or SSS (side-side-side).
- Use Law of Sines for ASA, AAS, or sometimes SSA (with ambiguity checks).
Common Mistakes to Avoid
- Using degrees in a calculator set to radians (or vice versa).
- Forgetting that the known angle in SAS must be the included angle between known sides.
- Entering impossible side sets that do not satisfy triangle inequality.
- Dropping the negative sign in −2ab cos(C).
Real-World Applications
The Law of Cosines appears in surveying, navigation, CAD design, robotics, architecture, and physics. Any time you model non-right triangular geometry, this formula can help estimate unknown distances and angles with precision.
FAQ
Is this different from the Pythagorean theorem?
Yes. The Pythagorean theorem only applies to right triangles. The Law of Cosines works for any triangle and becomes the Pythagorean theorem when C = 90° because cos(90°) = 0.
Can I compute other angles too?
Yes. Rename sides and angles in the same formula to solve for A or B.
What unit should sides be in?
Any consistent unit is fine (meters, feet, inches, etc.). Angles should be entered in degrees for this calculator.
Final Thought
If triangle problems ever feel messy, the Law of Cosines is your dependable tool for side-and-angle relationships. Use the calculator above to check homework, verify geometry designs, or speed up engineering calculations.