Home / Law of Cosines Calculator

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

  1. Enter two positive side lengths and their included angle from 0° through 180°.
  2. Check the units and definitions before comparing results with another source.
  3. 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.

Explore more calculation resources

Keep exploring related tools, explanations, conversions, and topic pages in The Calc Studio. These links are selected around the subject of this page so you can move to the next useful calculation without returning to search.

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.
  • Pythagorean Theorem Calculator — Find the hypotenuse of a right triangle from the two perpendicular sides.
  • Angle Between Vectors Calculator — Find the smaller angle between two non-zero three-dimensional vectors from their components.
  • Arc Length Calculator — Calculate circular arc length and sector area from a radius and central angle in degrees.
  • 2×2 Matrix Calculator — Add, subtract and multiply 2×2 matrices and calculate each determinant with transparent row and column inputs.
Browse by categoryMath CalculatorsConstruction CalculatorsScience & Electronics CalculatorsBusiness CalculatorsDate & Time CalculatorsFinancial Calculators

Task collections

  • Math & Statistics Calculators — Free math and statistics calculators for Bayes theorem, set operations, matrices, complex numbers, vector products, normal distributions, averages, percentages, standard deviation, geometry, equations, and number systems.
  • Calculators for Students — Free student calculators for grades, percentages, fractions, probability, normal distributions, matrices, vectors, complex numbers, statistics, geometry, and scientific math.
  • Science & Electronics Calculators — Free science and electronics calculators for projectile motion, force, buoyancy, fluid pressure, Reynolds number, heat transfer, capacitors, RC time constants, resistance, and electrical relationships.
  • Business & Work Calculators — Free business and work calculators for ROI, markup, break-even, sales commission, DSO/DPO, customer-acquisition payback, weighted sales pipelines, labour cost per unit, FTE staffing, email growth, and creator RPM.

Related guides

  • How to Calculate a Z-Score — Learn how a z-score shows how far a value is from the mean in standard-deviation units.
  • How to Calculate Age from a Date of Birth — Learn how exact age is calculated using years, months, and days rather than a rough year difference.
  • How to Calculate Salary from an Hourly Rate — Convert hourly pay into weekly, monthly, and annual estimates and understand the assumptions behind the result.

Related terms

  • Area — Understand area as the amount of two-dimensional surface inside a shape and review common formulas.
  • Markup — Learn what markup means, how markup is calculated from cost and selling price, and how it differs from margin.
  • Percent Difference — Understand percent difference, when it is appropriate, and how it differs from percentage change and percent error.

Useful conversions

  • °C to °F — Convert Celsius to Fahrenheit with a free temperature converter, formula, examples, and common temperatures.
  • °F to °C — Convert Fahrenheit to Celsius with a free temperature converter, formula, examples, and common temperatures.
  • cm to feet — Convert centimeters to feet with a free cm to feet converter, formula, examples, and a quick reference table.

Browse all calculators · Read all guides · Open the glossary · See all converters · Browse collections

Want to keep learning? Move from a calculator to its formula guide, glossary definition, unit conversion, or task collection to compare related methods and tools.

Optional Premium: save calculation history across visits and remove promotional blocks. See Premium.