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.
Your figures
Updates as you typeHow this is worked out
7 steps
- Three sides are known, so each angle comes from the law of cosines.
- cos A = (b² + c² − a²) / (2·b·c) → A = 36.869898°
- cos B = (a² + c² − b²) / (2·a·c) → B = 53.130102°
- cos C = (a² + b² − c²) / (2·a·b) → C = 90°
- Area = ½·a·b·sin C = ½ × 3 × 4 × sin 90° = 6
- Perimeter = 12; s = 6
- 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
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.
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.
