Law of Cosines Calculator
Calculate the missing side or angle of a triangle using the Law of Cosines: c² = a² + b² − 2ab cos(C).
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. Follow the units and input format printed next to each field. Where a unit selector is available, choose the units that match your data.
Review your inputs
Double-check that all values are correct and match the units or format shown 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 computes the output in your browser and displays the results, with units clearly labeled, as soon as they are ready — 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°.
Add the live Law of Cosines Calculator to your site. Free to embed, with a link back to MegaCalc.