Law of Cosines Calculator
Calculate the missing side or angle of a triangle using the Law of Cosines: c² = a² + b² − 2ab cos(C).
This free online law of cosines calculator provides instant results with no signup required. All calculations run directly in your browser — your data is never sent to a server. Enter your values below and see results update in real time as you type. Perfect for everyday calculations, homework, or professional use.
The angle between sides a and b
Results
Side c
6.245 units
How to Use This Calculator
Enter your input values
Fill in all required input fields for the Law of Cosines Calculator. Most fields include unit selectors so you can work in your preferred unit system — metric or imperial, whichever matches your problem.
Review your inputs
Double-check that all values are correct and that you have selected the right units for each field. Incorrect units are the most common source of calculation errors and can produce results that are off by factors of 2, 10, or more.
Read the results
The Law of Cosines Calculator instantly computes the output and displays results with units clearly labeled. All calculations happen in your browser — no loading time and no data sent to a server.
Explore parameter sensitivity
Try adjusting individual input values to see how the output changes. This is a quick and effective way to develop intuition about how different parameters influence the result and to identify which inputs have the largest effect.
When to Use This Calculator
- •Use the Law of Cosines Calculator when you need a quick mathematical result without writing out all the steps manually, saving time on repetitive calculations.
- •Use it to verify hand calculations on tests or assignments and catch arithmetic mistakes.
- •Use it when teaching or explaining mathematical concepts to others, demonstrating how changing inputs affects the result.
- •Use it to explore the behavior of mathematical functions across a range of inputs.
Related Calculators
Pythagorean Theorem Calculator
Calculate the missing side of a right triangle using the Pythagorean theorem a² + b² = c².
30-60-90 Triangle Calculator
Calculate all sides of a 30-60-90 special right triangle from any one known side. Enter the shortest side, longer leg, or hypotenuse to find all three sides using the fixed ratio 1:sqrt(3):2, fundamental for trigonometry, geometry, and standardized testing.
Coterminal Angle Calculator
Find the positive and negative coterminal angles of a given angle by adding or subtracting 360 degrees. Coterminal angles share the same terminal side in standard position, essential for trigonometry, unit circle problems, and rotational mechanics.
Equilateral Triangle Calculator
Calculate the area, perimeter, and height of an equilateral triangle from its side length.
Heron's Formula Calculator
Calculate the area of a triangle from all three side lengths using Heron's formula.
Isosceles Triangle Calculator
Calculate the area, perimeter, and height of an isosceles triangle from its equal side and base.
About Law of Cosines Calculator
The Law of Cosines is a generalization of the Pythagorean theorem that works for any triangle, not just right triangles. It states that c² = a² + b² − 2ab cos(C), where C is the angle between sides a and b, and c is the side opposite angle C. When C = 90°, cos(C) = 0 and the formula reduces to the Pythagorean theorem. The Law of Cosines can be used to find a missing side when two sides and the included angle are known (SAS), or to find an angle when all three sides are known (SSS). It is fundamental in surveying, navigation, physics, and engineering. This calculator finds the third side given two sides and the included angle. The law was first stated by Euclid in a geometric form and later generalized using trigonometric notation.
The Math Behind It
Formula Reference
Law of Cosines
c² = a² + b² − 2ab cos(C)
Variables: a, b = known sides; C = included angle; c = opposite side
Worked Examples
Example 1: Surveying a plot
Two sides measure 100 m and 80 m with a 45° angle between them.
c ≈ 71.32 m
Common Mistakes & Tips
- !Using degrees instead of radians in a calculator set to radian mode (or vice versa).
- !Forgetting the minus sign in the formula (it is −2ab cos(C)).
- !Applying the Law of Cosines when the Law of Sines would be simpler and sufficient.
Related Concepts
Used in These Calculators
Calculators that build on or apply the concepts from this page:
Frequently Asked Questions
When should I use the Law of Cosines instead of the Law of Sines?
Use the Law of Cosines for SAS (two sides and included angle) or SSS (all three sides) cases. The Law of Sines is better for ASA, AAS, and some SSA cases.
Can the result be negative under the square root?
No, as long as the inputs form a valid triangle. The expression a² + b² − 2ab cos(C) is always non-negative for 0° < C < 180°.
Embed this calculator on your site
Paste this snippet into your blog, course page, or documentation to drop a live, interactive Law of Cosines Calculator into your page.
Free to embed — includes a link back to MegaCalc.