Law of sines and cosines

Both laws solve any triangle, not only right ones. If you know an angle and the side across from it, use the law of sines. If you do not, use the law of cosines.

A B C c a b

Law of sinesa / sin A = b / sin B = c / sin C

Law of cosinesc² = a² + b² − 2ab cos C

When to use the law of sines vs cosines. Check what you are given.

Look for a matched pair: an angle and the side opposite it. Matched pair, law of sines. No pair, law of cosines. In every picture below, the highlighted parts are the ones you know.

ASA or AAS

Two angles and a side

Law of sines

SSA

Two sides and an angle that is not between them

Law of sines, check for two answers

SAS

Two sides and the angle between them

Law of cosines

SSS

All three sides

Law of cosines

AAA gives the shape but not the size, so three angles alone cannot fix a side length. If the triangle has a 90° angle, the Pythagorean theorem and SOH CAH TOA are faster.

Law of cosines formula. Pythagoras with a correction.

The angle in the formula is the one between the two sides you square and add. The side by itself on the left is the one across from that angle. Swap the letters and you get three equivalent forms.

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

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

b² = a² + c² − 2ac cos B

SAS: find the third side

11 8 40° c = ?
  1. c² = 8² + 11² − 2(8)(11) cos 40°Angle between the two known sides
  2. c² = 185 − 176(0.766) ≈ 50.18Multiply first, then subtract
  3. c ≈ 7.08Square root

SSS: find an angle

9 7 5 C = ?
  1. cos C = (5² + 7² − 9²) / (2 · 5 · 7)C is opposite the side 9
  2. cos C = −7 / 70 = −0.1Negative: the angle is obtuse
  3. C = cos⁻¹(−0.1) ≈ 95.7°Inverse cosine

When C = 90°, cos C = 0 and the formula collapses to a² + b² = c². The cosine is negative for angles over 90°, which is why obtuse triangles get a larger c² (see the unit circle for why).

Law of sines formula. Ratios that match.

Every side over the sine of its opposite angle is the same number. Pick the two fractions that contain only one unknown, then cross-multiply.

c a b A B C

a / sin A = b / sin B = c / sin C

ASA or AAS: find a side

A = 48°, B = 65°, a = 12. Find b.

  1. b / sin 65° = 12 / sin 48°a and A are the matched pair
  2. b = 12 · sin 65° / sin 48°Solve for b
  3. b ≈ 14.6Degree mode on

Need c? First C = 180° − 48° − 65° = 67°, then c = 12 · sin 67° / sin 48° ≈ 14.9.

Area from two sides and the angle between them: ½ · a · b · sin C. For the 8 and 11 triangle with a 40° angle, that is about 28.3 square units.

The ambiguous case (SSA). Sometimes two triangles fit.

Given angle A, the side a across from it, and a second side b, swing side a like a gate. It can miss the base, touch it, or cross it twice. Compute the height first: h = b · sin A.

A C b = 10 h = 5 B₁ B₂ a = 7 a = 7

A = 30°, b = 10, a = 7. Then h = 5, and 5 < 7 < 10, so two triangles fit: B₁ ≈ 134.4° and B₂ ≈ 45.6°.

0

a < h The side falls short of the base. No triangle.

1

a = h It just touches. One right triangle.

2

h < a < b It crosses twice. Two triangles.

1

a ≥ b One crossing makes a triangle. One triangle.

Why two answers: sin B = (10 · sin 30°) / 7 ≈ 0.714, and an angle and its supplement (180° minus it) have the same sine, so B ≈ 45.6° or B ≈ 134.4°. Keep the second one only if it still fits: 30° + 134.4° is under 180°, so it does.

Practice the decision, not the arithmetic. Pick the law before you press a button.

  1. 1Sketch the triangle and label every given piece on it.
  2. 2Look for an angle with its opposite side. Found one: law of sines. None: law of cosines.
  3. 3Find the third angle with 180° minus the other two whenever you can.
  4. 4In SSA, compute h = b · sin A before solving, so you know how many triangles to expect.

Triangle problems go wrong at step 2 far more than in the algebra. If a problem will not give way, photograph it and work through it with an AI trig tutor that shows each step and asks you why you chose that law. Then Stephen AI can quiz you on fresh SAS, SSA and SSS setups until the choice is automatic.

Working through a triangle problem step by step with an AI tutor

Law of sines and cosines, answered.

What is the law of sines?

In any triangle, each side divided by the sine of its opposite angle gives the same number: a / sin A = b / sin B = c / sin C. Use it when you know an angle and the side across from it, plus one more piece. With A = 48°, B = 65° and a = 12, b = 12 · sin 65° / sin 48° ≈ 14.6.

What is the law of cosines?

It is the Pythagorean theorem with a correction term for any triangle: c² = a² + b² − 2ab cos C. Here C is the angle between sides a and b, and c is the side across from C. Use it when you know two sides and the angle between them (SAS), or all three sides (SSS).

When do you use the law of sines vs the law of cosines?

Look for a matched pair, an angle and the side opposite it. If you have one, use the law of sines (cases AAS, ASA and SSA). If you do not, use the law of cosines (cases SAS and SSS). The law of sines needs a known ratio a / sin A to work from, and in SAS and SSS no side has a known opposite angle yet.

What is the ambiguous case of the law of sines?

It happens with SSA, two sides and an angle that is not between them. The sine of an angle equals the sine of its supplement, so sin B = 0.714 gives both B ≈ 45.6° and B ≈ 134.4°. Depending on the side lengths there can be no triangle, one right triangle, one triangle, or two triangles. Always check whether the second angle still fits inside 180° with the given angle.

How do you know if SSA has 0, 1 or 2 triangles?

Given angle A, the side a opposite it, and the other side b, compute the height h = b · sin A. If a < h, there is no triangle. If a = h, there is one right triangle. If h < a < b, there are two triangles. If a ≥ b, there is exactly one triangle. With A = 30°, b = 10 and a = 7, h = 5, and 5 < 7 < 10, so there are two triangles.

How do you find an angle with the law of cosines?

Rearrange it to solve for the cosine: cos C = (a² + b² − c²) / (2ab), then take the inverse cosine. For sides 5, 7 and 9, the angle opposite 9 has cos C = (25 + 49 − 81) / 70 = −0.1, so C ≈ 95.7°. A negative cosine means the angle is obtuse. Find the largest angle first, because the other two are then guaranteed to be acute.

Why does the law of cosines turn into the Pythagorean theorem?

If C = 90°, then cos C = 0, so the term 2ab cos C vanishes and c² = a² + b² remains. The Pythagorean theorem is the special case of the law of cosines for right triangles.

Can you use the law of sines on a right triangle?

Yes. Since sin 90° = 1, the law of sines gives a / sin A = c, which is the same as sin A = a / c, the right-triangle ratio. It works, but SOH CAH TOA and the Pythagorean theorem are usually quicker when there is a 90° angle.

What is the area formula that goes with these laws?

With two sides and the angle between them, area = ½ · a · b · sin C. For sides 8 and 11 with a 40° angle between them, area = ½ · 8 · 11 · sin 40° ≈ 28.3 square units.

Why is my law of sines or cosines answer wrong?

The most common cause is calculator mode. Set it to degrees unless the problem is in radians. The next causes are pairing a side with the wrong angle (the angle must be opposite), forgetting the square root at the end of the law of cosines, and subtracting 2ab cos C before multiplying (compute 2ab cos C first, then subtract it from a² + b²).

Matched pair? Sines.
No pair? Cosines.

Label the triangle, choose the law, check SSA for a second answer. Stephen AI walks through each step with you and explains the ones you get stuck on.

Stephen AI Get it for Free