Skip to main content

The Law of Sines and Cosines

Right-triangle trigonometry is powerful, but the world is full of triangles that are not right-angled: the triangle formed by two mountain peaks and an observer, the triangle a ship's navigator sketches between two lighthouses, the triangle a surveyor lays across a valley. For these oblique (non-right) triangles, SOH-CAH-TOA no longer applies directly. The Law of Sines and the Law of Cosines are the two master tools that let you find every missing side and angle of any triangle, given just enough information. Learn them well and no triangle can hide its measurements from you.

Learning Objectives

  • State and apply the Law of Sines to solve triangles given angle-side pairs (AAS, ASA).
  • State and apply the Law of Cosines to solve triangles given SAS and SSS.
  • Recognise and correctly handle the ambiguous case (SSA), where 0, 1, or 2 triangles may exist.
  • Compute triangle area from side-angle data using 12absinC \tfrac{1}{2}ab\sin C.
  • Choose the right law for the information you are given, and check answers for consistency.

Quick Answer

For any triangle with angles A,B,CA, B, C opposite sides a,b,ca, b, c:

asinA=bsinB=csinC(Law of Sines) \frac{a}{\sin A} = \frac{b}{\sin B} = \frac{c}{\sin C} \qquad\text{(Law of Sines)}

c2=a2+b22abcosC(Law of Cosines) c^2 = a^2 + b^2 - 2ab\cos C \qquad\text{(Law of Cosines)}

Use the Law of Sines when you have a matched angle-side pair plus one more piece (AAS, ASA), and for the ambiguous SSA case. Use the Law of Cosines when you have two sides and the included angle (SAS) or all three sides (SSS). The area of the triangle is 12absinC \tfrac{1}{2}ab\sin C. The Law of Cosines is a generalisation of the Pythagorean theorem: when C=90°C = 90°, the cosC\cos C term vanishes and it becomes c2=a2+b2c^2 = a^2 + b^2.

Where It Came From

The need for these laws was born in the sky. Ancient astronomers wanted to predict the positions of the Sun, Moon, and planets, and to measure distances they could never physically traverse — the distance to the Moon, the size of the Earth, the moment of an eclipse. All of these reduce to solving triangles whose vertices are celestial or terrestrial points, and almost none of those triangles are conveniently right-angled.

The Greek astronomer Hipparchus (c. 150 BC) built the first table of chords, the ancestor of the sine table, precisely to attack such problems. Ptolemy, in the Almagest (c. 150 AD), extended this into a full computational toolkit for astronomy. But the laws in their modern trigonometric form came from the medieval Islamic world and later India: mathematicians such as Abu al-Wafa and al-Biruni (10th–11th centuries) developed the spherical and plane laws of sines to fix the direction of Mecca (the qibla) and the times of prayer from any city — a genuine, daily, geographic need. The Persian scholar Nasir al-Din al-Tusi (13th century) is credited with the first clear, standalone treatment of trigonometry as its own subject, stating the Law of Sines for plane and spherical triangles.

The Law of Cosines has an even older skeleton: Euclid's Elements (Book II, Propositions 12 and 13, c. 300 BC) proves a purely geometric version describing how the square on a side of a triangle relates to the other two sides and the projection between them. Recast in the language of cosines centuries later — the term "cosine" and the modern algebraic form crystallised around the work of François Viète and others in the 16th century — it became the tool we use today. Then came surveying and navigation: as Europe mapped coastlines and empires triangulated territory, these laws moved from the observatory to the theodolite, letting a surveyor compute an unreachable distance from two measured angles and one measured baseline. The motivation was never abstract — it was always "how far, how big, in which direction?"

Concept 1 — The Law of Sines: Triangles Built From Angle-Side Pairs

The Law of Sines says that in any triangle, the ratio of a side to the sine of its opposite angle is the same for all three sides:

asinA=bsinB=csinC \frac{a}{\sin A} = \frac{b}{\sin B} = \frac{c}{\sin C}

Intuitively, bigger angles sit opposite bigger sides, and this equation pins down the exact proportionality. It is the tool of choice whenever you can pair a known angle with its known opposite side, because that fixes the common ratio, and then any other known angle immediately gives its opposite side (or vice versa).

When it applies: ASA (angle-side-angle), AAS (angle-angle-side), and the ambiguous SSA case.

Worked example (AAS). A triangle has A=40°A = 40°, B=75°B = 75°, and side a=12a = 12 (the side opposite AA). Find side bb.

First find the ratio using the complete pair aa and AA:

asinA=12sin40°=120.6428=18.67 \frac{a}{\sin A} = \frac{12}{\sin 40°} = \frac{12}{0.6428} = 18.67

Then

b=sinB×18.67=sin75°×18.67=0.9659×18.67=18.03 b = \sin B \times 18.67 = \sin 75° \times 18.67 = 0.9659 \times 18.67 = 18.03

So b18.0b \approx 18.0. As a sanity check, B=75°B = 75° is larger than A=40°A = 40°, and indeed b=18.0b = 18.0 is larger than a=12a = 12 — the big-angle-big-side rule holds.

Concept 2 — The Law of Cosines: When Sines Aren't Enough

The Law of Sines fails when you have no complete angle-side pair to start from — for instance, if you know two sides and the angle between them (SAS), or all three sides (SSS). Here the Law of Cosines takes over:

c2=a2+b22abcosC c^2 = a^2 + b^2 - 2ab\cos C

with the symmetric versions a2=b2+c22bccosAa^2 = b^2 + c^2 - 2bc\cos A and b2=a2+c22accosBb^2 = a^2 + c^2 - 2ac\cos B. Notice the structure: it looks exactly like the Pythagorean theorem plus a correction term 2abcosC-2ab\cos C that accounts for the angle not being 90° 90°. If C=90°C = 90°, then cos90°=0\cos 90° = 0 and the correction disappears.

Worked example (SAS). Two roads leave a town at an angle of C=110°C = 110° between them. One car drives 8 8 km along one road, another drives 11 11 km along the other. How far apart are the cars?

c2=a2+b22abcosC=82+1122(8)(11)cos110° c^2 = a^2 + b^2 - 2ab\cos C = 8^2 + 11^2 - 2(8)(11)\cos 110°

c2=64+121176×(0.3420)=185+60.19=245.19 c^2 = 64 + 121 - 176 \times (-0.3420) = 185 + 60.19 = 245.19

c=245.19=15.66 c = \sqrt{245.19} = 15.66

The cars are about 15.7 15.7 km apart. The angle exceeds 90° 90°, so cosC\cos C is negative, which adds to the distance — the obtuse angle spreads the roads apart, exactly as intuition demands.

Worked example (SSS → angle). A triangle has sides a=7a = 7, b=9b = 9, c=12c = 12. Find angle CC (opposite the longest side). Rearrange the Law of Cosines to solve for the cosine:

cosC=a2+b2c22ab=49+811442(7)(9)=14126=0.1111 \cos C = \frac{a^2 + b^2 - c^2}{2ab} = \frac{49 + 81 - 144}{2(7)(9)} = \frac{-14}{126} = -0.1111

C=cos1(0.1111)=96.4° C = \cos^{-1}(-0.1111) = 96.4°

Because cc is the longest side, CC is the largest angle, and here it is obtuse — the negative cosine flagged that immediately.

Concept 3 — The Ambiguous Case (SSA)

The trickiest situation is SSA: you know two sides and an angle not between them. Because the sine function gives the same value for an angle and its supplement (sinθ=sin(180°θ)\sin\theta = \sin(180° - \theta)), the data may correspond to two different triangles, exactly one, or none at all. This is why SSA is called the ambiguous case, and why you must always check.

Worked example (two solutions). Given A=30°A = 30°, a=6a = 6, b=10b = 10. Find angle BB.

sinBb=sinAa    sinB=bsinAa=10sin30°6=10×0.56=0.8333 \frac{\sin B}{b} = \frac{\sin A}{a} \;\Rightarrow\; \sin B = \frac{b\sin A}{a} = \frac{10\sin 30°}{6} = \frac{10 \times 0.5}{6} = 0.8333

Now sinB=0.8333\sin B = 0.8333 has two possible angles in the valid range:

  • B1=sin1(0.8333)=56.4°B_1 = \sin^{-1}(0.8333) = 56.4°
  • B2=180°56.4°=123.6°B_2 = 180° - 56.4° = 123.6°

Check each: with B1=56.4°B_1 = 56.4°, the angles sum to 30°+56.4°=86.4°<180° 30° + 56.4° = 86.4° < 180° — valid. With B2=123.6°B_2 = 123.6°, the sum is 30°+123.6°=153.6°<180° 30° + 123.6° = 153.6° < 180° — also valid. Both triangles exist. For the first, C1=180°86.4°=93.6°C_1 = 180° - 86.4° = 93.6°; for the second, C2=180°153.6°=26.4°C_2 = 180° - 153.6° = 26.4°. This genuinely happens because side a=6a = 6 is long enough to swing back and touch the base at two different points.

How to tell how many triangles exist (given angle AA, opposite side aa, and adjacent side bb). Compute the "height" h=bsinAh = b\sin A:

  • If a<ha < h: no triangle (side aa is too short to reach the base).
  • If a=ha = h: one right triangle.
  • If h<a<bh < a < b: two triangles (the ambiguous case above).
  • If aba \geq b: one triangle.

In the example, h=10sin30°=5h = 10\sin 30° = 5, and 5<6<10 5 < 6 < 10, confirming two triangles.

Concept 4 — The Area of a Triangle From Trigonometry

The familiar area formula 12×base×height\tfrac{1}{2}\times\text{base}\times\text{height} needs a height, which you rarely measure directly. Trigonometry rewrites it using two sides and their included angle:

Area=12absinC=12bcsinA=12acsinB \text{Area} = \tfrac{1}{2}ab\sin C = \tfrac{1}{2}bc\sin A = \tfrac{1}{2}ac\sin B

The reasoning: drop a height from one vertex; that height equals bsinCb\sin C, and multiplying by the base aa and halving gives the formula.

Worked example. A triangular plot has two sides of length a=50a = 50 m and b=65b = 65 m with an included angle C=72°C = 72°. Its area is

Area=12(50)(65)sin72°=12(3250)(0.9511)=1625×0.9511=1545.5 m2 \text{Area} = \tfrac{1}{2}(50)(65)\sin 72° = \tfrac{1}{2}(3250)(0.9511) = 1625 \times 0.9511 = 1545.5 \text{ m}^2

About 1546 1546 square metres. If instead you knew all three sides, you would use Heron's formula, which is derived from the Law of Cosines.

Real-World Applications

  • Navigation and GPS. A ship taking bearings to two known landmarks forms an oblique triangle; the Law of Sines fixes its position. Triangulation is the geometric heart of positioning.
  • Surveying and construction. Surveyors measure one accessible baseline and two angles, then compute distances across rivers, ravines, or property lines they cannot walk — the classic AAS/ASA use.
  • Astronomy. Measuring the distance to a nearby star by parallax uses the tiny triangle formed by the star and two positions of Earth six months apart; the Law of Sines converts the parallax angle into a distance.
  • Engineering and physics. Resolving forces or velocities that meet at non-right angles (the "triangle of forces") uses the Law of Cosines to find the resultant magnitude and the Law of Sines to find its direction.
  • Land area and agriculture. Irregular plots are split into triangles and each area computed with 12absinC\tfrac{1}{2}ab\sin C.

Common Mistakes

Mistake 1: Using the Law of Sines when you have SAS or SSS. Students reach for the Law of Sines out of habit, but with two sides and the included angle you have no complete angle-side pair, so the ratio is undefined. Correction: SAS and SSS always start with the Law of Cosines. Only after finding a new part do you (optionally) switch to the Law of Sines.

Mistake 2: Ignoring the second solution in the SSA (ambiguous) case. Because sin1\sin^{-1} on a calculator only returns the acute angle, students report one triangle when two exist. Correction: Whenever you solve for an angle with the Law of Sines, test the supplement 180°θ 180° - \theta as well; keep it if the three angles still sum to less than 180° 180°.

Mistake 3: Finding the largest angle last, or forgetting a side can be obtuse. When using the Law of Cosines on SSS, some students find a small angle first with the Law of Sines and then get confused by an obtuse angle. Correction: Use the Law of Cosines to find the largest angle first (opposite the longest side), because only the Law of Cosines unambiguously distinguishes acute from obtuse via the sign of the cosine — a negative value directly signals an obtuse angle.

Comparison and Connections

Both laws solve triangles, but they attack different information:

SituationKnownBest law
ASAtwo angles + included sideLaw of Sines
AAStwo angles + a non-included sideLaw of Sines
SSAtwo sides + non-included angleLaw of Sines (check ambiguity)
SAStwo sides + included angleLaw of Cosines
SSSall three sidesLaw of Cosines

Key connections: the Law of Cosines generalises the Pythagorean theorem (set C=90°C = 90°). The area formula 12absinC\tfrac{1}{2}ab\sin C links to the SAS case since it uses the same two-sides-and-included-angle data. And the common ratio in the Law of Sines is not arbitrary — it equals 2R 2R, the diameter of the triangle's circumscribed circle, tying trigonometry to circle geometry.

Practice Questions

Recall

State the Law of Cosines for side aa, and explain what it reduces to when A=90°A = 90°. Answer: a2=b2+c22bccosAa^2 = b^2 + c^2 - 2bc\cos A. When A=90°A = 90°, cos90°=0\cos 90° = 0, so it becomes a2=b2+c2a^2 = b^2 + c^2, the Pythagorean theorem.

Understanding

Why can the SSA configuration produce two triangles, while SAS never does? Guidance: SSA solves for an angle via its sine, and sinθ=sin(180°θ)\sin\theta = \sin(180°-\theta), so two supplementary angles may both fit. SAS solves for the opposite side directly via the Law of Cosines, which yields a single positive length — no ambiguity.

Application

A triangle has B=48°B = 48°, a=20a = 20, c=25c = 25. Find side bb. Answer: This is SAS (angle BB is between sides aa and cc). b2=a2+c22accosB=400+6252(20)(25)cos48°=10251000(0.6691)=1025669.1=355.9b^2 = a^2 + c^2 - 2ac\cos B = 400 + 625 - 2(20)(25)\cos 48° = 1025 - 1000(0.6691) = 1025 - 669.1 = 355.9, so b=355.918.9b = \sqrt{355.9} \approx 18.9.

Analysis

Given A=25°A = 25°, a=4a = 4, b=9b = 9, determine how many triangles exist, and justify. Answer: Height h=bsinA=9sin25°=9(0.4226)=3.80h = b\sin A = 9\sin 25° = 9(0.4226) = 3.80. Since a=4>h=3.80a = 4 > h = 3.80 but a=4<b=9a = 4 < b = 9, we are in the range h<a<bh < a < b, so two triangles exist. (Check: sinB=bsinA/a=9(0.4226)/4=0.951\sin B = b\sin A / a = 9(0.4226)/4 = 0.951, giving B=72.0°B = 72.0° or 108.0° 108.0°, both leaving a positive third angle.)

FAQ

Q: How do I know which law to use? Look at your data. If you can pair an angle with its opposite side (ASA, AAS, SSA), use the Law of Sines. If you have two sides and the included angle (SAS) or all three sides (SSS), use the Law of Cosines. A quick memory hook: the Law of Cosines is for "the two S's with no matching angle."

Q: Do these laws work for right triangles too? Yes. They are fully general. For a right triangle they still work, but SOH-CAH-TOA and the Pythagorean theorem are usually faster, so most people reserve these laws for oblique triangles.

Q: Why does my calculator only give one answer for the ambiguous case? Because sin1\sin^{-1} is defined to return an angle between 0° and 90° 90° (or up to 180° 180° depending on range), it gives only the principal value. You must manually check whether the supplement 180°θ 180° - \theta also yields a valid triangle.

Q: Can I always use the Law of Cosines instead of the Law of Sines to avoid the ambiguity? Often yes. If you have enough information to set up a Law of Cosines equation, it returns a unique side or a signed cosine, sidestepping the two-answer problem. In pure SSA data you can even solve a quadratic in the unknown side with the Law of Cosines, and the two positive roots reveal the two triangles honestly.

Q: What if I get an error taking sin1\sin^{-1} of a number bigger than 1? That means sinB\sin B came out greater than 1 1, which is impossible — it is the calculator's way of telling you no triangle exists with that data (the given side was too short to close the triangle).

Quick Revision

  • Law of Sines: asinA=bsinB=csinC\dfrac{a}{\sin A} = \dfrac{b}{\sin B} = \dfrac{c}{\sin C} — use for ASA, AAS, SSA.
  • Law of Cosines: c2=a2+b22abcosCc^2 = a^2 + b^2 - 2ab\cos C — use for SAS, SSS.
  • Find an angle from SSS: cosC=a2+b2c22ab\cos C = \dfrac{a^2 + b^2 - c^2}{2ab}.
  • Area: 12absinC\tfrac{1}{2}ab\sin C (two sides and included angle).
  • Ambiguous SSA test: with h=bsinAh = b\sin A — none if a<ha < h; one if a=ha = h or aba \geq b; two if h<a<bh < a < b.
  • Always check the supplement 180°θ 180° - \theta when the Law of Sines gives an angle.
  • Law of Cosines = Pythagoras + a 2abcosC-2ab\cos C correction term.

Prerequisites

  • Trigonometry Overview
  • Right-triangle trigonometry and the sine, cosine, and tangent ratios
  • The Pythagorean theorem
  • The unit circle and trigonometric identities
  • Vectors and the resolution of forces (physics applications)
  • Circle geometry (the circumradius relation a/sinA=2Ra/\sin A = 2R)

Next Topics

  • Spherical trigonometry (the same laws on a sphere, for navigation and astronomy)
  • Heron's formula for area from three sides
  • Applications in Calculus and modelling