Law of Cosines Calculator

Quick answer

The law of cosines calculator finds the third side of any triangle from two sides and the angle between them, and then the remaining angles and the area.

°
Side c
—
Angle A
— °
Angle B
— °
Area
—

The law of cosines generalises the Pythagorean theorem to triangles without a right angle.

How to use the Law of Cosines Calculator

  1. Side a
  2. Side b
  3. Angle C (between a and b)

Results update as you type, and every field accepts the units shown in its menu.

How it works

Plug two sides and the included angle into the formula to get the third side, then use it again for the other angles.

Inputs explained

Field What to enter
Side a A number
Side b A number
Angle C (between a and b) In °

What each result means

  • Side c = sqrt([Side a]^2 + [Side b]^2 – 2×[Side a]×[Side b]×cos(rad([Angle C (between a and b)])))
  • Angle A = deg(acos(([Side b]^2 + [Side c]^2 – [Side a]^2)÷(2×[Side b]×[Side c])))
  • Angle B = 180 – [Angle A] – [Angle C (between a and b)]
  • Area = [Side a]×[Side b]×sin(rad([Angle C (between a and b)]))÷2

Example values

How the main result changes when Side a changes and everything else stays at the example values above:

Side a Side c
3.5 8.2009
5.25 7.7505
7 7.6818
8.75 8.0047
10.5 8.6755
14 10.7712

Formula

c² = a² + b² − 2ab cos(C)

Worked example

Inputs — Side a: 7; Side b: 10; Angle C (between a and b): 50 °.
Results — Side c = 7.681779; Angle A = 44.271 °; Angle B = 85.729 °; Area = 26.811556.

Frequently asked questions

When do I use the law of sines instead?

When you know two angles and a side, or two sides and a non-included angle.

What if C is 90°?

The formula reduces to Pythagoras.

What formula does the Law of Cosines Calculator use?

c² = a² + b² − 2ab cos(C).

Cite this calculator

Speedy Calculator. (2026). Law of Cosines Calculator. Speedy Calculator. https://speedycalculator.com/calculators/math/law-of-cosines/