Free calculatorLive resultsSteps and sourcesEmbed on your site, free

Law Cosines Calculator

Law cosines calculator works out Side a and Side b from Known parts, Side a (opposite A) and Side b (opposite B). The default figures on this page give area of 6.000000; change any entry and the result, the working and the sources update together.

Area
6.000000
Law of Sines and Law of Cosines Triangle Solver
Side a
3.000000
Side b
4.000000
Side c
5.000000
Angle A
36.869898
Angle B
53.130102
Angle C
90.000000
Perimeter
12.000000
Semiperimeter (s)
6.000000
Circumradius (R)
2.500000
Inradius (r)
1.000000
Altitude to side a
4.000000
Triangle type
right scalene
Case solved
SSS
Law used
Law of cosines for each angle
Ambiguous (two triangles fit)
no
Worked out from Weisstein, Eric W. "Law of Cosines." MathWorld — c² = a² + b² − 2ab·cos C and 2 other sources.

Your figures

Updates as you type

How this is worked out

7 steps
  1. Three sides are known, so each angle comes from the law of cosines.
  2. cos A = (b² + c² − a²) / (2·b·c) → A = 36.869898°
  3. cos B = (a² + c² − b²) / (2·a·c) → B = 53.130102°
  4. cos C = (a² + b² − c²) / (2·a·b) → C = 90°
  5. Area = ½·a·b·sin C = ½ × 3 × 4 × sin 90° = 6
  6. Perimeter = 12; s = 6
  7. R = abc / (4·area) = 2.5; r = area / s = 1

Its 5 worked examples are re-run on every release, last on 15 September 2026. What changed

Sources and references

3 sources

What the law cosines calculator calculates

Solves any triangle from SSS, SAS, ASA, AAS or SSA data using the law of sines and the law of cosines, returning all sides, all angles, area, perimeter, circumradius and inradius, and both triangles in the ambiguous case.

How to use this law cosines calculator

Enter Known parts, Side a (opposite A), Side b (opposite B) and Side c (opposite C). Side a updates as you type, and “Use a worked example” loads checked figures you can adjust. Change one figure at a time to see what drives the result.

How the result is worked out

Open “How this is worked out” beside the result for the step-by-step calculation behind Side a, Side b and Side c.

The method follows Weisstein, Eric W. "Law of Cosines." MathWorld — c² = a² + b² − 2ab·cos C, Weisstein, Eric W. "Law of Sines." MathWorld — a/sin A = b/sin B = c/sin C = 2R and Weisstein, Eric W. "Heron's Formula." MathWorld — area and the inradius/circumradius identities.

SSS 3-4-5 right triangle example

With Side a (opposite A): 3, Side b (opposite B): 4, Side c (opposite C): 5, the calculator returns Angle C: 90, Area: 6, Perimeter: 12. This example is checked against an independent source in the test suite.

What you can compare

Change one input at a time to see how it affects Side a, Side b and Side c. The inputs you can vary are Known parts, Side a (opposite A), Side b (opposite B), Side c (opposite C), Angle A and Angle B.

Results are general information, not financial, tax, legal, medical or engineering advice. Check any decision that matters with a qualified professional.

Embed this calculator on your website

Copy this code into any page. The calculator appears with the figures currently entered, sizes itself to fit, and a small credit line links back here. Free, no account, no ads inside it, no tracking of your readers. Set your own figures and fixed fields; Personal removes the credit line, sets your colour and shows you which sites use it.

Preview

See something wrong? Report a problem with this calculator

Frequently asked questions

How do you calculate the Law of Cosines?

Solves any triangle from SSS, SAS, ASA, AAS or SSA data using the law of sines and the law of cosines, returning all sides, all angles, area, perimeter, circumradius and inradius. Open “How this is worked out” beside the result to see each step for your own figures.

How to put Law of Cosines in calculator?

It needs Known parts, Side a (opposite A), Side b (opposite B), Side c (opposite C), Angle A and Angle B. Nothing else is required, and the figures stay in your browser.

How to use Law of Cosines with three sides?

The result gives Side a, Side b, Side c, Angle A, Angle B and Angle C, each labelled with its unit so the figure can be read on its own.

What information do I need for the law cosines calculator?

You need Known parts, Side a (opposite A), Side b (opposite B), Side c (opposite C), Angle A, Angle B, Angle C and Angle unit. The page opens with default figures that give area of 6.000000, so you can see the scale before entering your own.

What does this law cosines calculator show?

It shows Side a, Side b, Side c, Angle A, Angle B, Angle C, Area and Perimeter, with the working and any warnings for your entries.

Can I check how the law cosines calculator result was calculated?

Yes. The “How this is worked out” section shows the calculation steps, and the sources section identifies the references used for the method.

Related calculators

View all related calculators12 more