Solving Triangles

Three facts determine a triangle; trigonometry finds the rest. Drag triangles to see the law of sines and the law of cosines at work, and find when one set of facts allows two triangles

Solving Triangles

Three facts about a triangle fix it, as compass and ruler showed in the congruence lesson. Two laws turn those three facts into the other three numbers: the law of sines and the law of cosines. Together they let a surveyor, a navigator or an engineer find any side or angle they cannot measure directly.

The Law of Sines

Drag the corners anywhere and watch the three ratios side ÷ sine of the opposite angle stay equal to the circle’s diameter. Press “Show why” for the proof, then make A obtuse.

6.61
a ÷ sin A (measured)
6.61
b ÷ sin B (measured)
6.61
c ÷ sin C (measured)
6.61
diameter 2R of the circle (measured)
Biggest side: c = 6.31, opposite the biggest angle, C = 72.6°. A bigger angle has a bigger sine (up to 90°, and an obtuse angle is always the largest), so the law of sines puts the longest side across from it.
corners you draga (BC)b (CA)c (AB)angles (biggest filled)circumcircle, centre O

Each ratio is worked out from a side and an angle measured off the drawing, and the diameter from the circle through the three corners, separately: they agree to the two decimal places shown. Lengths are in units, angles in degrees; the longest side is drawn thicker.

Go deeper:Why every ratio is the diameter

In any triangle the sides are in proportion to the sines of the opposite angles, and the common ratio is the diameter of the circle through the three corners:

a ÷ sin A = b ÷ sin B = c ÷ sin C = 2R

The proof is in the figure. Draw the diameter from B through the centre O to the far side of the circle, B′. The triangle BCB′ has a right angle at C, because an angle in a semicircle is a right angle. The angle at B′ stands on the same arc BC as the angle at A, so the two are equal (the inscribed angle theorem); if A is obtuse, B′ is on the other side of BC and its angle is 180° − A, which has the same sine. In the right-angled triangle BCB′, the side BC opposite B′ is the hypotenuse BB′ times the sine of the angle at B′, so a = 2R sin A. The same argument from A or from C gives the other two. If A is a right angle, BC is itself a diameter and a = 2R directly. See also: Circles.

The rule was known in some form before the thirteenth century, but Nasir al-Din al-Tusi (13th century) set out plane and spherical trigonometry as a subject in its own right, and is credited with the law of sines for plane triangles. Since sine grows from 0° to 90°, and a triangle has at most one obtuse angle, which is then its largest, the longest side is always opposite the largest angle.

The law gives ratios, not lengths. Three angles fix the three sines, and so the shape, but every enlargement has the same angles: one length is needed before anything can be measured. That is why the surveyor always starts with a measured baseline.

The Law of Cosines

Open and close the angle C and watch the two amber rectangles: they are what c² lacks compared with a² + b², and they vanish at 90°. Then find an angle from three sides.

13.00
c², measured
25.00
a² + b², measured
6.00
amber rectangle in a², measured
6.00
amber rectangle in b², measured
12.00
2ab cos C, from the formula
c² = a² + b² − 2ab cos C: 13.00 = 25.00 − 12.00 = 13.00. C is acute, so cos C is positive: c² falls short of a² + b² by the two amber rectangles, which are cut out of the squares on a and b. The other pieces match too: the blue rectangle in a² equals the blue one in c², and the green one in b² equals the green one in c².
corners you dragab cos C, twicematching pieces next to Bmatching pieces next to Aaltitudes

c² and a² + b² are measured from the drawing, as are the amber rectangles (one side is a, or b, and the other is how far the altitude’s foot is from C); 2ab cos C comes from the formula. Dashed amber means removed, solid amber means added. Lengths are in units, areas in square units.

Go deeper:Pythagoras corrected

Pythagoras’ theorem holds only when C is a right angle. For any other angle there is a correction, and it depends on how far C is from 90°:

c² = a² + b² − 2ab cos C

Euclid has it without cosines, as two propositions of Book II of the Elements: II.12 for an obtuse angle, where the square on the side opposite it exceeds the other two squares by twice a rectangle, and II.13 for an acute angle, where it falls short by the same. The rectangle has one side a and the other the distance from C to the foot of the altitude from A, which is b cos C: so its area is ab cos C. The demo draws all three altitudes. Each cuts a square in two, and the six pieces match in pairs, the pair next to C having area ab cos C, the pair next to B ac cos B and the pair next to A bc cos A. Adding up, c² is a² + b² with the two pieces next to C taken away. When C is obtuse, cos C is negative, the foot falls outside the side, and the pieces are added instead. See also: Pythagoras’ Theorem.

Jamshīd al-Kāshī, in the fifteenth century, gave the law in trigonometric form, and in France it is still called al-Kashi’s theorem. Turned round, it gives an angle from three sides: cos C = (a² + b² − c²) ÷ 2ab. The sign of a² + b² − c² alone says whether C is acute, right or obtuse.

Which law to use? The law of cosines needs an angle with both its sides known (SAS) or all three sides (SSS). The law of sines needs a side and the angle opposite it, which ASA and AAS supply once the angles are made to add to 180°. SSA can use the law of sines too, but must check for a second answer.

Solve It

Choose what you know, set it with the sliders, and read how the rest is found, step by step. In SSA, slide side a and watch the number of triangles go from none to one to two and back to one.

Known: two angles and a side that is not between them. Set them with the sliders.

Given A = 40°, B = 65°, a = 5.0 units.

  1. The angles add to 180°, so C = 180° − 40° − 65° = 75°.
  2. The law of sines: b ÷ sin B = a ÷ sin A = 7.78, so b = 7.78 × sin 65° = 7.05 units.
  3. In the same way c = 7.78 × sin 75° = 7.51 units.
9.78 units
half the perimeter, s
17.02
area by Heron, √(s(s − a)(s − b)(s − c)) (square units)
17.02
area as ½ab sin C (square units)
given sidesgiven anglesfound

The triangle is drawn from the solved numbers with A at the left and B along the base. Angles are rounded to a tenth of a degree and lengths to two decimal places; the steps keep full precision and round only what they print. Heron’s formula uses only the sides and ½ab sin C uses an angle, so their agreement is a check.

Go deeper:Which facts solve a triangle

The congruence lesson found that SSS, SAS, ASA and AAS each fix a triangle, and the two laws then find the other three numbers. SSA is different. Given A, the side b next to it and the side a opposite it, the law of sines gives sin B = b sin A ÷ a, and an acute angle and an obtuse angle share every sine. With h = b sin A, the height of C above the other arm: if a is less than h there is no triangle; if a = h there is one, with a right angle at B; if a is between h and b there are two; and if a is at least b there is one, since the obtuse choice would leave nothing for C. If A is 90° or more, a must be longer than b, and then there is one. AAA cannot be solved for lengths at all: it fixes only the shape. See also: Congruence and Similarity.

Heron of Alexandria (1st century CE) gave the area from the three sides alone in his Metrica:

area = √(s(s − a)(s − b)(s − c)), with s = ½(a + b + c)

It agrees with ½ab sin C, the base times half the height, for every triangle. A computer needs some care with both laws. For a very thin triangle, s − a can be a small difference of large numbers and lose its digits, so a stable rearrangement of Heron’s formula, which sorts the sides first, is used here. And an angle near 0° should not be found as the arccos of a number very close to 1: cos changes so little near 0° that the last digits of the number decide the angle. Finding the angle from both its sine and its cosine together avoids the problem, and that is what this page does.

Key Takeaways

  • Law of sines: a ÷ sin A = b ÷ sin B = c ÷ sin C, and each equals the circle’s diameter 2R.
  • Law of cosines: c² = a² + b² − 2ab cos C, which is Pythagoras when C = 90°.
  • SSS, SAS, ASA and AAS give one triangle; SSA can give none, one or two.
  • Heron’s formula finds the area from the three sides alone, and agrees with ½ab sin C.

Spot a mistake or have an idea?

Search