Skip to content
CalculatorAtlas

Cosine Rule Calculator

Tested

Apply the cosine rule to find a missing side or angle of a triangle from the sides and the included angle.

Tested, not yet published. The formula for this calculator is implemented and passes its automated checks. This page stays non-indexable until it is reviewed and published.

°

Results

Enter your values and press Calculate. Results appear here.

  • • Result

Quick answer

Apply the cosine rule to find a missing side or angle of a triangle from the sides and the included angle. Enter side b, side c and included angle A and the cosine rule calculator returns side a.

Related tools: Law of Cosines Calculator: Third side of a triangle from two sides and the included angle (law of cosines). Cosine Calculator: cos of an angle in degrees or radians. Inverse Cosine Calculator: arccos (inverse trigonometric function) with the result in degrees and radians.

This page covers the same calculation as the law of cosines calculator page; the two give identical results.

How to use the Cosine Rule Calculator

  1. Enter side b (above 0).
  2. Enter side c (above 0).
  3. Enter included angle A (°) (between 0 and 179.999999).
  4. Press Calculate to see the result, and use Reset to start again.
Inputs of the Cosine Rule Calculator
InputWhat to enterAllowed values
Side bA number> 0
Side cA number> 0
Included angle AA number, in °> 0, ≤ 179.999999

Formula and method

Formula

a² = b² + c² − 2bc·cos A

IEEE-754 double precision; shown to at most 6 decimal places.

Law of cosines.

Worked examples

These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.

Example 1

Inputs: Side b = 3; Side c = 4; Included angle A = 90.

Results of example 1
ResultValue
Side a5

Example 2

Inputs: Side b = 1; Side c = 1; Included angle A = 60.

Results of example 2
ResultValue
Side a1

The first line is the headline result (side a). IEEE-754 double precision; shown to at most 6 decimal places.

How the result changes with side b

Holding every other input at the first worked example, this table changes only side b. It shows how sensitive the answer is to that one value; each row was produced by running this calculator.

How the result changes with side b
Side bSide a
1.54.272002
35
67.211103
1212.649111

What happens with invalid input

These messages are produced by the calculator itself, so you know what to fix.

  • Included angle A: entering "0" shows "Included angle A must be greater than 0." beside that field and no result.

Choosing between the Cosine Rule Calculator and similar calculators

Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.

Choosing between the Cosine Rule Calculator and similar calculators
CalculatorYou enterIt returns
[Law of Cosines Calculator](/math/law-of-cosines-calculator/)side b, side c and included angle ASide a
[Cosine Calculator](/math/cosine-calculator/)angle and unitcos(60°)
[Inverse Cosine Calculator](/math/inverse-cosine-calculator/)valuearccos(0.5)
[Sine Rule Calculator](/math/sine-rule-calculator/)angle A, side a and angle BSide b
[Trigonometry Calculator](/math/trigonometry-calculator/)angle and unitsin

Background: trigonometry

In a right triangle, sin θ is the opposite side over the hypotenuse, cos θ the adjacent side over the hypotenuse and tan θ the opposite over the adjacent. Their reciprocals are cosecant, secant and cotangent. At 30° the values are sin = 0.5, cos = 0.866025 and tan = 0.577350.

Check the angle unit before you calculate: degrees convert to radians by multiplying by π/180, so 30° is about 0.5236 rad. Some values are undefined, for example tan 90°, because the cosine is zero there and the ratio would divide by zero.

Assumptions and limitations

  • Angle between 0° and 180°

If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for included angle A to confirm this.

Frequently asked questions

What does the Cosine Rule Calculator calculate?

Apply the cosine rule to find a missing side or angle of a triangle from the sides and the included angle. It returns Side a.

What formula does the Cosine Rule Calculator use?

a² = b² + c² − 2bc·cos A. Law of cosines.

What do I need to enter in the cosine Rule Calculator?

You enter Side b, Side c and Included angle A (°).

How is the result rounded or limited?

IEEE-754 double precision; shown to at most 6 decimal places. Angle between 0° and 180°.

What is an example of a cosine Rule result?

With side b 3, side c 4 and included angle A 90, the side a is 5.

Where does the method come from?

The method follows: Standard mathematical definition.

Sources

  • Standard mathematical definition

Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.