Calculators.Life Calculator
Math

Cosine Rule Calculator

Input Parameters

Scenarios
Select which angle or side you want to solve for using the Law of Cosines.
Length of side a, or angle A if solving for side a.
Length of side b, or angle B if solving for side b.
Length of side c, or angle C if solving for side c.

Computed Results

Angle A
60
Angle B60
Angle C60
Side a10
Side b10
Side c10
Perimeter (P)30
Semi-perimeter (s)15
Area (K)43.3013
Inradius (r)2.8868
Circumradius (R)5.7735

The cosine rule calculator helps you solve for unknown sides and angles of a triangle using the Law of Cosines. By entering known side lengths and angles, you can determine the remaining dimensions, as well as the triangle's area, perimeter, inradius, and circumradius.

How to Use the Cosine Rule Calculator

This tool allows you to solve a triangle when you know either three sides (SSS) or two sides and the included angle (SAS). Follow these steps to find the missing values:

  1. Select what to calculate: Choose whether you are solving for an angle (given three sides) or a specific side (given two sides and the included angle).
  2. Enter the known values: Input the lengths of the sides and the known angle. Ensure you match the side or angle to the correct input field based on your selection.
  3. Choose your units: Select whether your angles are measured in degrees or radians.
  4. Set significant figures: Adjust the precision of your results by selecting the desired number of significant figures.
  5. Review the results: The calculator will display all three angles, all three sides, the perimeter, semi-perimeter, area, inradius, and circumradius.

Formula & Explanation

The Law of Cosines relates the lengths of the sides of a triangle to the cosine of one of its angles. It is a generalization of the Pythagorean theorem for non-right triangles. The standard formulas are:

c² = a² + b² − 2ab × cos(C)
a² = b² + c² − 2bc × cos(A)
b² = a² + c² − 2ac × cos(B)

To solve for an angle when all three sides are known, the formula is rearranged. For example, to find angle C:

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

The calculator also determines the area using Heron's formula, where s is the semi-perimeter:

Area = √(s × (s − a) × (s − b) × (s − c))

Inputs & Outputs

Here is a breakdown of the data you can enter and the results the calculator provides.

Input/OutputDescription
CalculateThe specific side or angle you want to solve for based on your known data.
Side a (or Angle A)The length of side a, or the measure of angle A if solving for side a.
Side b (or Angle B)The length of side b, or the measure of angle B if solving for side b.
Side c (or Angle C)The length of side c, or the measure of angle C if solving for side c.
Angle UnitsThe unit of measurement for angles (degrees or radians).
Significant FiguresThe level of precision for the calculated results.
Angles (A, B, C)The calculated measures of the triangle's three interior angles.
Sides (a, b, c)The calculated lengths of the triangle's three sides.
Perimeter (P) & Semi-perimeter (s)The total distance around the triangle and half of that distance.
Area (K)The total surface area enclosed by the triangle.
Inradius (r) & Circumradius (R)The radius of the inscribed circle and the circumscribed circle, respectively.

Verified Scenario Walkthroughs

Below are examples of how the calculator processes different sets of inputs.

Example 1: Calculating Angles from Three Known Sides

If you have a triangle with sides measuring 3, 4, and 5, and you want to find the angles in degrees (rounded to 4 significant figures):

Example 2: Solving for Side A using SAS

If you know Angle A is 60°, Side b is 10, and Side c is 10, and you want to find Side a (rounded to 5 significant figures):

Example 3: Solving for Side B using Radians

If you know Side a is 5, Angle B is 1.5708 radians, and Side c is 5 (rounded to 3 significant figures):

Practical Use Cases

The Law of Cosines is frequently used in geometry and trigonometry to solve triangles that do not have a right angle. It is particularly useful when you know the lengths of all three sides and need to find the angles, or when you know two sides and the angle between them and need to find the third side. This mathematical principle is applied in fields such as surveying, navigation, and physics to determine distances and angles that cannot be measured directly.

Frequently Asked Questions

When should I use the Law of Cosines instead of the Law of Sines?

Use the Law of Cosines when you know all three sides of a triangle (SSS) or two sides and the included angle (SAS). The Law of Sines is used when you know two angles and one side (AAS or ASA), or two sides and a non-included angle (SSA).

Can the Law of Cosines be used on right triangles?

Yes. If the angle is 90 degrees, the cosine of 90 degrees is zero. The term −2ab × cos(90°) becomes zero, and the formula simplifies to the Pythagorean theorem (c² = a² + b²).

Author portrait
About the Author
Arnab Biswas

Calculator developer and SEO strategist who builds practical online calculators and tests calculation logic, input handling, and expected results using real-world scenarios.