ProMathTools
ProMathTools

Law of Cosines Calculator

Our Law of Cosines Calculator helps you find the length of an unknown side in any triangle. Just enter two known sides and the angle between them (SAS), and we'll do the math for you. It's a fundamental tool for geometry and trigonometry students.

Length of the first known side

Length of the second known side

The angle included between Side a and Side b

How it works

Our Law of Cosines Calculator helps you find the length of an unknown side in any triangle. Just enter two known sides and the angle between them (SAS), and we'll do the math for you. It's a fundamental tool for geometry and trigonometry students.


The Formula

c² = a² + b² - 2ab cos(C)

Worked Example

  1. Example: Finding Side c

    Imagine a triangle with side `a = 5`, side `b = 7`, and the included angle `C = 60°`. Using the Law of Cosines, `c² = 5² + 7² - 2 * 5 * 7 * cos(60°)`. This simplifies to `c² = 25 + 49 - 70 * 0.5 = 74 - 35 = 39`. So, `c = √39 ≈ 6.245`.


Tips, Assumptions & Limitations

  • Ensure the angle you enter is the one *between* the two known sides (SAS case).
  • Angles should be entered in degrees. The calculator handles the conversion to radians.
  • The Law of Cosines works for any triangle, not just right-angled ones.
FAQ

The Law of Cosines is used to find the length of an unknown side in any triangle when you know two sides and the included angle (SAS). It can also find an unknown angle if all three sides are known (SSS).

The Pythagorean Theorem only applies to right-angled triangles. The Law of Cosines is a more general formula that works for all triangles, including acute, obtuse, and right-angled ones. It essentially extends the Pythagorean Theorem.

This specific calculator is designed to find a missing side when you have two sides and the included angle. To find an angle, you would need to rearrange the Law of Cosines formula and input all three side lengths.

Companion article

Law of Cosines Explained: Find a Triangle's Missing Side

Related Calculators

Related Guides


How this calculator works

The Law of Cosines is a powerful rule in trigonometry that helps you solve triangles. It's especially useful when you know two sides and the angle between them (SAS), or when you know all three sides (SSS) and need to find an angle. This guide will focus on using it to find a missing side.

Explanation

This law extends the Pythagorean theorem to all triangles, not just right-angled ones. It states that the square of any side of a triangle is equal to the sum of the squares of the other two sides minus twice the product of those two sides and the cosine of the included angle. It's a cornerstone for solving non-right triangles.

Formula

The Law of Cosines can be written in three forms, depending on which side or angle you are trying to find: c² = a² + b² - 2ab cos(C)
a² = b² + c² - 2bc cos(A)
b² = a² + c² - 2ac cos(B) Here, a, b, and c are the lengths of the sides of the triangle, and A, B, and C are the angles opposite those sides, respectively.

Worked example

Imagine a triangle where side `a` is 10 units, side `b` is 12 units, and the angle `C` between them is 45 degrees. To find side `c`, apply the formula: `c² = 10² + 12² - 2 * 10 * 12 * cos(45°)`. Since `cos(45°) ≈ 0.7071`, `c² = 100 + 144 - 240 * 0.7071 = 244 - 169.704 = 74.296`. Taking the square root, `c ≈ 8.62` units. This shows how the Law of Cosines helps find unknown sides.

How to use this tool

Using our Law of Cosines Calculator is straightforward. Simply enter the lengths of the two known sides into the 'Side a' and 'Side b' fields. Then, input the measure of the included angle (the angle between sides 'a' and 'b') in degrees into the 'Angle C' field. Click 'Calculate' to instantly see the length of the missing side 'c'.

Frequently asked questions

What is the Law of Cosines used for?
The Law of Cosines is used to find the length of an unknown side in any triangle when you know two sides and the included angle (SAS). It can also find an unknown angle if all three sides are known (SSS).
How is the Law of Cosines different from the Pythagorean Theorem?
The Pythagorean Theorem only applies to right-angled triangles. The Law of Cosines is a more general formula that works for all triangles, including acute, obtuse, and right-angled ones. It essentially extends the Pythagorean Theorem.
Can I use this calculator to find an angle?
This specific calculator is designed to find a missing side when you have two sides and the included angle. To find an angle, you would need to rearrange the Law of Cosines formula and input all three side lengths.

Read the full guide →

About UsBlogChrome ExtensionFAQsTerms and ConditionsPrivacy PolicySitemap
EmailLinkedInFacebook

© 2025-2026 PromathTools. All rights reserved.

Built by KruskalCode – SaaS & Automation Experts · EverydayDevTools