📏 Law of Cosines Calculator: Find a Side or All Angles

Choose what you know and enter the sides and angle.

No ratings yet — be the first

Enter details

Log in or create a free account to save your inputs and results, so you don't have to enter them again next time.🔒 No spam, ever. We never sell or share your details, and you can delete your history or account at any time. Privacy policy

Fill in the details and click Calculate to see your results.

Formula at a glance

Law of Cosines Calculator: Side — a² = b² + c² − 2bc·cos A. Example: b = 5, c = 8, A = 60° → Side a: 7
How the Law of Cosines Calculator works: Side — a² = b² + c² − 2bc·cos A

Rate this calculator

Was it useful? A quick star rating helps others — and you can leave a comment too.
Rate it: ★ ★ ★ ★ ★

📘 About the Law of Cosines Calculator

The law of cosines, a² = b² + c² − 2bc·cos A, works for every triangle. When A is 90°, cos A = 0 and it becomes Pythagoras' theorem. Use it to find the third side when you know two sides and the angle between them, or to find the angles when you know all three sides.

Surveyors use it to find distances across a lake or field: measure two sides from one point and the angle between them, and the law of cosines gives the third distance.

🧮 Formula

Side
a² = b² + c² − 2bc·cos A
Angle
cos A = (b² + c² − a²) ÷ 2bc

✏️ Worked examples

b = 5, c = 8, A = 60°

You enter
What you knowTwo sides (b, c) and the angle A between them
Side b5
Side c8
Angle A (SAS case)60 °
You get
Side a7
Workinga² = b² + c² − 2bc·cos A = 49
Sidesa = 7, b = 5, c = 8
AnglesA = 60°, B = 38.2132°, C = 81.7868°
Area17.320508
Perimeter20

The third side a is 7.

Sides 3, 4, 5

You enter
What you knowAll three sides
Side a (SSS case)3
Side b4
Side c5
You get
AnglesA = 36.8699°, B = 53.1301°, C = 90°
Triangle typeRight-angled
Area6
Perimeter12

The angles are A = 36.8699°, B = 53.1301°, C = 90°.

🧭 How to use this calculator

What you enter

  • What you know
  • Side a (SSS case)
  • Side b
  • Side c
  • Angle A (SAS case) (°)

What you get

  • Side a
  • Working
  • Sides
  • Angles
  • Area
  • Perimeter

❓ Frequently asked questions

When do I use the law of cosines?

When you know two sides and the included angle (SAS) or all three sides (SSS).

How is it related to Pythagoras?

With a right angle, cos 90° = 0 and the formula becomes a² = b² + c².