📐 Mathematics · Topic 166 of 200

Law of Cosines

c² = a² + b² − 2ab cos C generalises Pythagoras.

Interactive labDrag the triangle’s corners

About this topic

The Law of Cosines, c² = a² + b² − 2ab cos C, generalises the Pythagorean theorem to any triangle; when C = 90° the last term vanishes. Use it when you know two sides and the included angle (SAS) or all three sides (SSS) to find an angle.

Rearranged: cos C = (a² + b² − c²)/(2ab). If the result is positive the angle is acute, if zero it is a right angle, and if negative the angle is obtuse. Unlike the Law of Sines, the cosine formula gives an unambiguous angle between 0° and 180°, so it is the safer choice when an obtuse angle might be involved. When finding all angles, compute the largest one first.

Example: two sides of 7 and 9 meet at 50°. The third side is c² = 49 + 81 − 2(7)(9)cos 50° = 130 − 126(0.643), about 49, so c is about 7.0. Ships leaving a port on different bearings, or a robot arm with two segments, use this to find the distance between endpoints.

Tips: pair the angle with the side opposite it, do the multiplication before the subtraction (the formula is not c² = (a² + b² − 2ab) cos C), and use radians or degrees consistently.

Key ideas

  1. Use with SAS or SSS
  2. Reduces to Pythagoras when C = 90°
  3. Solve for angles with rearrangement

Quick check

Use cases: where Law of Cosines helps

Number and algebra skills are used in science, engineering, budgeting and computing.

Frequently asked questions

What is Law of Cosines?

c² = a² + b² − 2ab cos C generalises Pythagoras.

What will I learn in Law of Cosines?

Use with SAS or SSS. Reduces to Pythagoras when C = 90°. Solve for angles with rearrangement.

Is Law of Cosines part of Mathematics?

Yes. It is one of 200 Mathematics topics on LearnViz HighSchoolEdu, with 3 key ideas, a live animation and a quick check.

Does the Law of Cosines lab work on a phone or tablet?

Yes. The animation resizes to fit your screen and supports touch, so you can drag, tap and slide with your finger.

How should I study Law of Cosines?

Read the summary and key ideas first, play with the interactive lab to see the idea in motion, then answer the quick check. If you get a question wrong, go back to the key idea it tests.

Do I need an account, and is my progress saved?

No account is needed. Marking a topic as learned is saved in your own browser, so it stays on that device and is not sent to a server.

More in Mathematics