Part of the Maths & Statistics suite · 235 calculators

Law of Cosines Calculator

The third side of a triangle from two sides and the angle between them — the law of cosines — with the other two angles, the area, the perimeter and the type of triangle it makes.

Pythagoras works for right angles; the law of cosines is its general form.

Results update as you type
Results
Third side c
6.66634
Angle A, opposite side a (°)
Angle B, opposite side b (°)
Area
Perimeter
Height onto side c
Type of triangle
Angles sum to (°)
Reviewed September 2026. Pure mathematics: the result does not depend on where you are. Terminology follows the Australian Curriculum (maths, brackets, decimal point).
No account required · Google Analytics off unless allowedCalculator arithmetic runs in your browserResults update as you type
All calculations run 100% in your browser. The calculator code does not submit your figures to GlobalCalc to obtain a result.
About law of cosines

How the law of cosines calculator works

Pythagoras works for right angles; the law of cosines is its general form. The square of the unknown side is the sum of the squares of the two known sides, less twice their product times the cosine of the included angle. Once all three sides are known, the same law run backwards gives each remaining angle, and half the product of two sides and the sine of their angle gives the area.

Formula: c² = a² + b² − 2ab cos C; cos A = (b² + c² − a²) / (2bc); area = ½ ab sin C

Worked examples

InputsThird side cNote
8 and 11 at 37°6.66634about 6.67
A right angle5Pythagoras: 5
An obtuse angle16.52271a long third side

Frequently asked questions

What is the law of cosines?

The generalisation of Pythagoras to any triangle: c² = a² + b² − 2ab cos C. With a right angle the cosine is zero and it collapses to a² + b² = c².

When do I use it?

When you know two sides and the angle between them (SAS), or all three sides and want the angles (SSS). Two angles and a side is a job for the law of sines.

Why does an obtuse angle make the third side longer?

Because the cosine of an angle over 90° is negative, so the correction term adds rather than subtracts. At 180° the sides simply lie end to end.

How is the area found?

Half the product of two sides and the sine of the angle between them — the same two sides and angle you started with, so no extra measurement is needed.

Does it work in three dimensions?

Any three points define a plane, so any triangle is flat and the law applies. It also underlies the distance between two vectors given their angle.

Where these figures come from

Last checked: September 2026. Formulas are fixed by mathematics and do not change with tax years or regulations.