Law of Cosines Calculator
The law-of-cosines calculator solves a triangle side when two side lengths and their included angle are known.
How to use this calculator
- Enter two positive side lengths and their included angle from 0° through 180°.
- Check the units and definitions before comparing results with another source.
- Change one input at a time when comparing scenarios, and keep the reporting period and assumptions consistent.
Formula used by the law of cosines calculator
c² = a² + b² − 2ab cos(C)
- c² = a² + b² − 2ab cos(C)
- The angle must be the included angle between the two entered sides. This is a geometric result, not a structural safety check.
- Inputs are checked for required values and valid ranges; displayed results are rounded for readability.
Worked examples
Worked example
Sides a = 5 and b = 7 enclose an angle of 60°.
c = √(25 + 49 − 70 cos 60°) = √39 ≈ 6.245 units.
c = √(25 + 49 − 70 cos 60°) = √39 ≈ 6.245 units.
Understanding the result
The law-of-cosines calculator solves a triangle side when two side lengths and their included angle are known.
The angle must be the included angle between the two entered sides. This is a geometric result, not a structural safety check.
Important notes
The angle must be the included angle between the two entered sides. This is a geometric result, not a structural safety check.
The result applies to the numbers and assumptions entered here; verify specifications for safety-critical or regulated uses.
Frequently asked questions
When is the law of cosines useful?
It is useful when two sides and the included angle are known, including triangles that are not right-angled.
Does it require a right triangle?
No. It works for general triangles when the inputs describe a valid triangle.
How do I use this calculator?
Enter two positive side lengths and their included angle from 0° through 180°.
Affiliate recommendations
Tools related to Law of Cosines Calculator
These tools are selected for the calculator topic. The Calc Studio may earn a commission from purchases made through affiliate links.
- Growth Wise SAT & ACT prep Visit partner ↗
SAT and ACT study tools, flashcards, and preparation resources for students.
See the Affiliate Disclosure for details.
Related calculators
- Right Triangle Trigonometry Calculator — Calculate a right triangle hypotenuse and acute angles from its two perpendicular side lengths.
- Triangle Calculator — Calculate triangle perimeter and area from three side lengths.
- Angle Between Vectors Calculator — Find the smaller angle between two non-zero three-dimensional vectors from their components.
- Pythagorean Theorem Calculator — Find the hypotenuse of a right triangle from the two perpendicular sides.
- 2×2 Matrix Calculator — Add, subtract and multiply 2×2 matrices and calculate each determinant with transparent row and column inputs.
- Arc Length Calculator — Calculate circular arc length and sector area from a radius and central angle in degrees.
Related explanations
Learn the method behind the number or compare the terminology before using the calculator.
- How to Calculate a Z-Score — Learn how a z-score shows how far a value is from the mean in standard-deviation units.
- Simple Interest Formula and Examples — Learn the simple interest formula, how to solve for principal, rate, time, and final amount.
- Area — Understand area as the amount of two-dimensional surface inside a shape and review common formulas.
This page provides a calculation tool plus explanatory information so you can understand what the result means and when the underlying method may not fit your situation.