Cosine rule calculator — formula and examples

The cosine rule says that the square of one side of a triangle equals the sum of the squares of the other two sides minus twice their product times the cosine of the angle between them: a² = b² + c² − 2bc cos A. Enter two sides and the angle between them, or all three sides, and the cosine rule calculator solves the triangle.

Enter the sides as positive numbers in the same units and the angles in degrees. Side a is opposite angle A, b is opposite B and c is opposite C.

a = 6.24b = 5c = 760°43.9°76.1°ABC
Sides and angles
a ≈ 6.24; b = 5; c = 7A = 60°; B ≈ 43.9°; C ≈ 76.1°

Triangle: a ≈ 6.24; b = 5; c = 7; A = 60°; B ≈ 43.9°; C ≈ 76.1°. Area ≈ 15.16.

Step-by-step breakdown
  1. Perimeter18.24
  2. Area (by Heron’s formula)15.16
  3. Perpendicular height to each sidea: 4.85; b: 6.06; c: 4.33
  4. Radius of the inscribed circle (incircle)r ≈ 1.66
  5. Radius of the circumscribed circle (circumcircle)R ≈ 3.61
  6. Type of triangleacute-angled, scalene

Step-by-step working

  1. Use the cosine rule to find the third side:

    a = √(b² + c² − 2bc · cos A) = √(5² + 7² − 2 · 5 · 7 · cos 60°) ≈ 6.245
  2. Use the cosine rule to find the angle:

    cos B = (a² + c² − b²) / 2ac = (6.245² + 7² − 5²) / (2 · 6.245 · 7) ≈ 0.7206, B ≈ 43.8979°
  3. The angles in a triangle add up to 180°:

    C = 180° − A − B ≈ 180° − 60° − 43.8979° ≈ 76.1021°

Formula

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

For a right angle, cos 90° = 0 and the cosine rule becomes Pythagoras’ theorem. For an obtuse angle the cosine is negative, so the side opposite it is the longest.

How we got there

a = √(b² + c² − 2bc · cos A) = √(5² + 7² − 2 · 5 · 7 · cos 60°) ≈ 6.245

To find an angle from three sides, use the same formula rearranged: cos A = (b² + c² − a²) / 2bc.

How to use the cosine rule

  1. Find the third side

    b = 5, c = 7, A = 60°: a² = 25 + 49 − 2 × 5 × 7 × 0.5 = 39, so a = √39 ≈ 6.24.

  2. Or find an angle from three sides

    a = 5, b = 6, c = 7: cos A = (36 + 49 − 25) / (2 × 6 × 7) = 60/84 ≈ 0.7143, so A ≈ 44.42°.

  3. Find the other angles

    Use the cosine rule again or the sine rule, then get the last angle from the 180° angle sum.

  4. Check

    The largest angle must be opposite the longest side.

Still stuck on cosine rule questions? Find a maths tutor for Year 10

Where the formula comes from

Draw the perpendicular from vertex C to side c. It splits the triangle into two right-angled triangles, and the one at A has sides b cos A and b sin A. Pythagoras’ theorem in the other one gives a² = (c − b cos A)² + (b sin A)² = b² + c² − 2bc cos A.

That is why the cosine rule is sometimes called a generalised form of Pythagoras’ theorem.

Where you need it

The distance between two points when you know how far away each one is and the angle between the directions; the diagonals of a parallelogram; forces acting at an angle in physics.

At GCSE the cosine rule is on the Higher tier, often in the same question as the area formula ½ab sin C. At A level it comes back in pure maths and in mechanics.

Common mistakes

  • Using the wrong angle: in the formula for a, the angle is A, the one opposite side a.
  • Forgetting the minus sign before 2bc cos A.
  • Not taking the square root: the formula gives a², not a.

Frequently asked questions

The square of any side of a triangle equals the sum of the squares of the other two sides minus twice their product times the cosine of the angle between them: a² = b² + c² − 2bc cos A.

Rearrange for the cosine: cos A = (b² + c² − a²) / 2bc, then find the angle with cos⁻¹ on your calculator. If the cosine is negative, the angle is obtuse.

Pythagoras’ theorem is a special case of it: when A = 90°, cos A = 0, so a² = b² + c².

Use the cosine rule when you know three sides, or two sides and the angle between them. Use the sine rule when you know a side and the angle opposite it.

A diagonal splits the parallelogram into two triangles: d² = a² + b² − 2ab cos θ, where θ is the angle between sides a and b.

Nothing special: the angle is obtuse, and the term −2bc cos A becomes positive, so the side opposite the obtuse angle is the longest.

Struggling with trigonometry?

Book a free introductory lesson with a Mathema tutor. 30 minutes online, no commitment — we find the gap and the plan to close it.