Skip to main content
Back to Calculators

Law of Cosines Calculator

Solve for a missing side or angle in any triangle using the Law of Cosines. Supports SAS and SSS cases.

Last updated: 2/3/2026
Data sources:Wolfram MathWorld

The Law of Cosines relates the lengths of the sides of a triangle to the cosine of one of its angles. It generalizes the Pythagorean theorem to all triangles, not just right-angled ones.

Calculator Inputs

Choose what you want to calculate

Leave empty if finding a side

Angle opposite to Side c. Leave empty if finding an angle.

Results

Enter values above to see your results

How It Works

Select "Find a Side" if you know two sides and the included angle (SAS). Select "Find an Angle" if you know all three sides (SSS). Enter the values and the calculator will provide the missing value along with a step-by-step solution.

Worked Examples

Finding Side c (SAS)

Identify values:a=5, b=7, C=49°= Given
Apply formula:c² = 5² + 7² - 2(5)(7)cos(49°)= Substitution
Calculate squares:c² = 25 + 49 - 70(0.6561)= Simplify
Solve for c²:c² = 74 - 45.92= 28.08
Take square root:c = √28.08= 5.30

Tips & Best Practices

  • Ensure your calculator is in Degree mode if entering degrees (this calculator uses Degrees).
  • For the SSS case, the sum of any two sides must be greater than the third side (Triangle Inequality).
  • The included angle must be between 0 and 180 degrees.

Frequently Asked Questions

What is the Law of Cosines formula?

The standard formula is c² = a² + b² - 2ab·cos(C), where C is the angle opposite side c.

When should I use the Law of Cosines?

Use it when you have a non-right triangle and know either: two sides and the included angle (SAS) or all three sides (SSS).

Can I use it for right triangles?

Yes! Since cos(90°) = 0, the formula simplifies to c² = a² + b², which is the Pythagorean theorem.