Law Of Cosines Calculator

Law of Cosines Calculator

Find a missing side or angle with the Law of Cosines.

Last updated: June 2026 | By Patchworkr Team

Main Calculator

Resulting Side c
6.244998
c^2 = a^2 + b^2 - 2ab cos(C)

Formula

c^2 = a^2 + b^2 - 2ab cos(C)
cos(C) = (a^2 + b^2 - c^2) / (2ab)

Use the first form to solve for side c and the second form to solve for angle C.

How to Use This Calculator

  1. Choose whether to solve for side c or angle C.
  2. Enter the known side lengths.
  3. Enter the angle or missing side, depending on mode.
  4. Read the result panel for the solved value.

Worked Example

a = 5, b = 7, and C = 60 degrees
c = sqrt(5^2 + 7^2 - 2 * 5 * 7 * cos(60 degrees)) = 6.244998

Frequently Asked Questions

Can I solve for angle C?

Yes. Switch to angle mode and enter the three side lengths.

What if the triangle is impossible?

The calculator rejects side lengths that do not satisfy the triangle inequality.

Are decimal inputs allowed?

Yes. Any finite real side length or angle in degrees is accepted.

Why are angles limited to 0 and 180 degrees?

A triangle angle must be strictly between 0 and 180 degrees to be valid.

Related Tools