Law of Sines and Cosines Solver

Solve any triangle from SSS, SAS, ASA, AAS or SSA — including both triangles in the ambiguous case — with every step. Free.

Add to Chrome

Three sides known. Solved with the law of cosines.

Summary

The law of sines and the law of cosines solve triangles with no right angle — the law of sines pairs each side with its opposite angle, and the law of cosines generalises the Pythagorean theorem.

Use the law of sines when you know two angles and a side (ASA or AAS), and the law of cosines when you know two sides and the included angle (SAS) or all three sides (SSS).

The SSA case is genuinely ambiguous: it can produce two valid triangles, one, or none, so a calculator answer taken at face value is often only half the solution.

01Definition

What are the law of sines and the law of cosines?

SOHCAHTOA only works when there is a right angle to define a hypotenuse. Most triangles do not have one, and for those you need two more general results: the law of sines and the law of cosines. Between them they solve any triangle from any three pieces of information (as long as one is a side).

The law of sines says each side divided by the sine of its opposite angle gives the same value: asin⁡A=bsin⁡B=csin⁡C\frac{a}{\sin A} = \frac{b}{\sin B} = \frac{c}{\sin C}. It needs a matched side–angle pair to get started, and works whenever you have one.

The law of cosines, c2=a2+b2−2abcos⁡Cc^2 = a^2 + b^2 - 2ab\cos C, is the Pythagorean theorem with a correction term for the angle not being 90°90°. When C=90°C = 90°, cos⁡C=0\cos C = 0, the correction vanishes, and it reduces exactly to a2+b2=c2a^2 + b^2 = c^2. It is the rule for when no side–angle pair is available.

Where you'll actually use this

  • Surveying distances across a river or ravine, where only angles and one accessible baseline can be measured.
  • Navigation and bearings: two legs of a course and the angle between them give the direct distance home.
  • Triangulation in GPS and cell-tower positioning.
  • Structural engineering, resolving forces in non-right-angled truss members.
  • Astronomy, where distances to nearby stars are computed by parallax triangles.
Oblique triangle
Any triangle without a right angle — the case these two rules exist to handle.
Included angle
The angle enclosed between two named sides — required by the law of cosines.
Ambiguous case (SSA)
Two sides and a non-included angle, which may describe two triangles, one, or none.
Matched pair
A side together with the angle opposite it — what the law of sines needs to start.
02Formulas

The formulas you need

Keep these on hand — every method below builds on them.

Law of sines
asin⁡A=bsin⁡B=csin⁡C\frac{a}{\sin A} = \frac{b}{\sin B} = \frac{c}{\sin C}

Each side over the sine of the angle opposite it. Needs one complete side–angle pair.

Law of sines for an angle
sin⁡Aa=sin⁡Bb\frac{\sin A}{a} = \frac{\sin B}{b}

Flip both fractions when the unknown is an angle — keeps it out of the denominator.

Law of cosines
c2=a2+b2−2abcos⁡Cc^2 = a^2 + b^2 - 2ab\cos C

Angle C must be the one enclosed between sides a and b.

Law of cosines for an angle
cos⁡C=a2+b2−c22ab\cos C = \frac{a^2 + b^2 - c^2}{2ab}

Rearranged for SSS — a negative result means C is obtuse.

Area of any triangle
A=12absin⁡CA = \tfrac{1}{2}ab\sin C

Two sides and the angle between them — no height needed.

Angle sum
A+B+C=180°A + B + C = 180°

Two angles known gives the third with no trigonometry at all.

03Methods

How to solve law of sines and cosines

Pick the method that fits the problem in front of you.

When to use it: Two angles and any side are given — always unambiguous.
  1. 1Find the third angle first with A+B+C=180°A + B + C = 180°.
  2. 2Pair the known side with its opposite angle to form the working ratio.
  3. 3Set the unknown side over its opposite angle equal to that ratio: bsin⁡50°=10sin⁡70°\frac{b}{\sin 50°} = \frac{10}{\sin 70°}.
  4. 4Cross-multiply and divide: b=10sin⁡50°sin⁡70°≈8.15b = \frac{10\sin 50°}{\sin 70°} \approx 8.15.
04Worked examples

Law of Sines and Cosines, solved step by step

From easy to hard — pick a problem to see its full solution.

A=70°,  B=50°,  a=10. Find b.A = 70°,\; B = 50°,\; a = 10. \text{ Find } b.
  1. 1A matched pair (aa with AA) exists, so use the law of sines.
  2. 2bsin⁡50°=10sin⁡70°\frac{b}{\sin 50°} = \frac{10}{\sin 70°}.
  3. 3b=10(0.766)0.940≈8.15b = \frac{10(0.766)}{0.940} \approx 8.15.
05Practice

Now you try

Work each one on paper first, then check your answer.

Problem 1
A=45°,  B=60°,  a=14. Find b.A = 45°,\; B = 60°,\; a = 14. \text{ Find } b.
Problem 2
a=5,  b=8,  C=100°. Find c.a = 5,\; b = 8,\; C = 100°. \text{ Find } c.
Problem 3
a=4,  b=5,  c=6. Find A.a = 4,\; b = 5,\; c = 6. \text{ Find } A.
Problem 4
Area with a=7,  b=10,  C=55°\text{Area with } a = 7,\; b = 10,\; C = 55°
Problem 5
A=50°,  a=6,  b=10. How many triangles?A = 50°,\; a = 6,\; b = 10. \text{ How many triangles?}
06Common mistakes

Where points get lost

Each of these shows up on real graded work — and each has a simple fix.

Missing the second triangle in the ambiguous SSA case.The calculator returns only the acute inverse sine, and that single answer looks complete.For SSA, always test 180°−B180° - B as well. If it leaves a positive third angle when added to the given angle, that second triangle is equally valid and the question wants both.
Using the law of cosines with an angle that is not between the two given sides.The formula gets treated as three interchangeable letters rather than a statement about a specific configuration.In c2=a2+b2−2abcos⁡Cc^2 = a^2 + b^2 - 2ab\cos C, angle CC must be enclosed by aa and bb, and cc must be opposite it. If your angle sits elsewhere, relabel the triangle first.
Evaluating a2+b2−2abcos⁡Ca^2 + b^2 - 2ab\cos C as (a2+b2−2ab)cos⁡C(a^2 + b^2 - 2ab)\cos C.The expression is read left to right and the subtraction looks like it groups the terms.Only the 2ab2ab is multiplied by cos⁡C\cos C. Compute 2abcos⁡C2ab\cos C as one quantity, then subtract it from a2+b2a^2 + b^2.
Finding a large angle with the law of sines and getting the acute answer.sin⁡30°\sin 30° and sin⁡150°\sin 150° are identical, so the inverse sine cannot tell them apart and defaults to acute.Find the largest angle with the law of cosines instead — cosine is negative for obtuse angles, so it identifies them unambiguously. Then use the sine rule for the remaining, definitely acute, angles.
Rounding intermediate angles to whole degrees and carrying the error forward.Each rounded value looks tidy, and the drift only becomes visible in the final answer.Keep full calculator precision through every intermediate step and round only the final answer. Rounding early can shift a side length by a whole unit.

Photo Math Solver shows every intermediate step, so slips like these are easy to catch before they cost you marks.

07FAQ

Frequently asked questions

Related topics

Ready to Solve Math Problems in Seconds?

No credit card required. Works in your browser. Free trial available. Learn math faster and smarter today!