maths.free › Trigonometry › Law of sines and law of cosines

Law of sines and law of cosines

Solving any triangle from three pieces of information.

Law of cosines: c² = a² + b² − 2ab cos C, which is Pythagoras with a correction for the angle. Law of sines: a/sin A = b/sin B = c/sin C. Picture it: two sides and the angle between them pin the third side; the figure is drawn from those numbers. Think it: the law of cosines is the dot product in disguise: |a − b|² = |a|² + |b|² − 2 a·b.

Worked example · triangle 5 7 with angle 60

Triangle 5 7 with angle 60

5,\ 7

Step by step

  1. a = 5,\ b = 7,\ C = 60^\circ

    Two sides and the included angle (SAS): find the third side with the law of cosines.

  2. c^2 = a^2 + b^2 - 2ab\cos C = 39

    Law of cosines.

  3. c = \sqrt{39} \approx 6.2450

  4. P = a + b + c = \sqrt{39} + 12

    Perimeter.

  5. s = \tfrac{P}{2} = \frac{\sqrt{39}}{2} + 6,\quad A = \sqrt{s(s-a)(s-b)(s-c)} = \frac{35 \sqrt{3}}{4} \approx 15.155

    Heron's formula for the area.

  6. \cos A = \frac{b^2 + c^2 - a^2}{2bc} = \frac{3 \sqrt{39}}{26} \Rightarrow A \approx 43.898^\circ

    Law of cosines for angle A (opposite side a).

  7. \cos B = \frac{a^2 + c^2 - b^2}{2ac} = \frac{\sqrt{39}}{26} \Rightarrow B \approx 76.102^\circ

    Law of cosines for angle B (opposite side b).

  8. \cos C = \frac{a^2 + b^2 - c^2}{2ab} = \frac{1}{2} \Rightarrow C \approx 60.000^\circ

    Law of cosines for angle C (opposite side c).

  9. A + B + C = 180.0^\circ

    The angles add to 180°: a acute, scalene triangle.

Reveal the answer
A = \frac{35 \sqrt{3}}{4} \approx 15.155,\quad P = \sqrt{39} + 12,\quad \angle \approx 43.9^\circ, 76.1^\circ, 60.0^\circ

Now you Pick a problem, or type or draw your own. Every step, a picture, the answer hidden until you ask.

Keep your own working

A free account adds notes on every lesson, a record of what you have finished, your solved problems in one place, and a tutor you can ask about this page. The maths itself is open to everyone, signed in or not.

Sign Up Login

Symbols used here

Tap any symbol for the full definition, a picture, and what every letter in it means.

How to: Law of sines and law of cosines

  1. Two sides and the included angle (SAS): find the third side with the law of cosines.
  2. Law of cosines.
  3. Perimeter.
  4. Heron's formula for the area.
  5. Law of cosines for angle A (opposite side a).
  6. Law of cosines for angle B (opposite side b).
  7. Law of cosines for angle C (opposite side c).
  8. The angles add to 180°: a acute, scalene triangle.

Questions people ask

Why radians instead of degrees?

A radian is the angle whose arc equals the radius, so it is a pure ratio rather than an arbitrary 1/360 of a turn. With radians the derivative of sin x is exactly cos x; with degrees a factor of π/180 appears everywhere.

Why does sin x = 1/2 have infinitely many solutions?

Sine repeats every full turn, and within one turn it reaches 1/2 twice (at π/6 and 5π/6). Add any whole number of turns to either and it is still true.

How do I remember the exact values?

Two triangles: the 45-45-90 with sides 1, 1, √2 and the 30-60-90 with sides 1, √3, 2. Every value for 30°, 45° and 60° is a ratio of those sides; symmetry gives the rest of the circle.

More in Trigonometry