Law of Sines & Cosines Calculator
Solve any triangle using the Law of Sines or Law of Cosines.
Law of Sines (use when you have ASA or SSA)
Law of Cosines (use when you have SAS or SSS)
Quick Examples
When to Use Each Law
Law of Sines
Use when you know:
- ASA: Two angles and the included side
- SSA: Two sides and a non-included angle (watch for ambiguous case)
Law of Cosines
Use when you know:
- SAS: Two sides and the included angle
- SSS: Three sides
Ambiguous Case (SSA)
When given SSA, there may be 0, 1, or 2 possible triangles. This depends on whether the opposite side is shorter than, equal to, or longer than the altitude from the known angle.
Worked Example: AAS with the Law of Sines
Given A = 40°, B = 60°, a = 8:
- Third angle: C = 180° − 40° − 60° = 80°.
- Side b: 8 × sin(60°)/sin(40°) ≈ 10.78.
- Side c: 8 × sin(80°)/sin(40°) ≈ 12.26.
Worked Example: ASA with the Law of Sines
Given A = 50°, B = 60°, c = 10 (the side between the two angles):
- Third angle: C = 180° − 50° − 60° = 70°.
- Side a: 10 × sin(50°)/sin(70°) ≈ 8.15.
- Side b: 10 × sin(60°)/sin(70°) ≈ 9.22.
Worked Example: SAS with the Law of Cosines
Given a = 7, b = 10, C = 60°, find side c:
- Apply the law: c² = 7² + 10² − 2·7·10·cos(60°).
- Compute: c² = 49 + 100 − 140 × 0.5 = 79.
- Result: c = √79 ≈ 8.89.
Worked Example: SSS with the Law of Cosines
Given a = 3, b = 4, c = 5, find the angles. The rearranged angle form gives each one:
B = arccos((a² + c² − b²)/(2ac)) = arccos(18/30) ≈ 53.13°
C = 180° − 36.87° − 53.13° = 90°
The Ambiguous Case, Worked
Given a = 8, b = 10, A = 35° (SSA — the non-included angle), test with sin(B) = b·sin(A)/a = 10·sin(35°)/8 ≈ 0.717:
- sin(B) < 1, so an acute solution exists: B₁ = arcsin(0.717) ≈ 45.80°, giving C₁ = 180° − 35° − 45.80° ≈ 99.20°.
- A second, obtuse solution B₂ = 180° − 45.80° ≈ 134.20° is possible only if B₂ + A < 180°: here 134.20° + 35° = 169.20° < 180°, so a second triangle exists with C₂ ≈ 10.80°.
The rule: if sin(B) > 1, no triangle exists; if sin(B) = 1, exactly one (right) triangle; otherwise check both the acute and obtuse candidates.
Case Reference Table
| Case | Known | Law used | Find |
|---|---|---|---|
| AAS | A, B, a | Sines | b, c, C |
| ASA | A, B, c | Sines | a, b, C |
| SAS | a, C, b | Cosines | c, A, B |
| SSS | a, b, c | Cosines | A, B, C |
| SSA | a, b, A | Sines | B, C, c (0, 1, or 2 solutions) |
Mnemonic: cosines for SAS and SSS; sines for everything else — the Law of Sines applies whenever you already have one angle-side opposite pair to start from.
Formulas Beyond Sides and Angles
Area from SAS: Area = ½ × a × b × sin(C)
Heron's formula: Area = √[s(s−a)(s−b)(s−c)], s = (a+b+c)/2
Extended law of sines: a/sin(A) = b/sin(B) = c/sin(C) = 2R
For the 3-4-5 triangle, Heron's formula gives s = 6 and Area = √(6·3·2·1) = √36 = 6 — no angles needed.
The Law of Cosines Is Pythagoras, Generalized
Set C = 90° in c² = a² + b² − 2ab·cos(C) and the correction term vanishes (cos 90° = 0), leaving a² + b² = c². So the law of cosines works on right triangles too — it just reduces to the formula you already know.
Why Three Angles Are Not Enough
Three angles (AAA) fix the shape of a triangle but not its size — you can scale a 40°-60°-80° triangle to any size. At least one side length is required before the other measurements are determined.
Real-World Uses
- Physics: the resultant of two force vectors separated by a known angle.
- Navigation: the distance between two GPS waypoints when the bearing angle is known.
- Surveying: triangulation fixes landmark positions from distance measurements.
- Construction: a roof with a 6:12 pitch rises at arctan(6/12) ≈ 26.57°.
Common Mistakes
- Degrees vs radians: geometry problems almost always use degrees; calculator trig functions often default to radians.
- Wrong side–angle pairing: side a is opposite angle A. Mislabelling feeds the law the wrong pair.
- Skipping the triangle inequality: if a + b ≤ c, no triangle exists — check before solving.
- Forgetting the ambiguous case: SSA can yield two valid triangles; always test the obtuse alternative.
- Ignoring validity: angles must sum to 180°, and each side must be shorter than the sum of the other two.
Solving SSS: Find the Largest Angle First
When all three sides are known, start with the angle opposite the longest side. The Law of Cosines (via arccos) always returns the correct angle between 0° and 180°, while the Law of Sines (via arcsin) cannot distinguish an acute angle from its obtuse supplement. Finding the largest angle first guarantees you catch the obtuse case.
Heron's Formula, Worked
For a = 7, b = 8, c = 9: the semiperimeter is s = (7 + 8 + 9)/2 = 12, and Area = √[12 × (12−7) × (12−8) × (12−9)] = √(12 × 5 × 4 × 3) = √720 ≈ 26.83 — area from sides alone, no angles needed.
Why the Laws Work: A Proof Sketch
Drop an altitude h onto side c, splitting it into segments. From the two right triangles, h = b·sin(A) = a·sin(B), so a/sin(A) = b/sin(B) — the Law of Sines. Extending the same construction with Pythagoras on each half yields c² = a² + b² − 2ab·cos(C). Both laws are the Pythagorean theorem and right-triangle trigonometry applied twice.
Solving Strategy Summary
- Identify your case: SSS, SAS, ASA, AAS, or SSA.
- SSS or SAS → Law of Cosines first (no opposite pair available).
- ASA, AAS, or SSA → Law of Sines first (an opposite pair is available).
- Finish with angle sum (A + B + C = 180°) rather than a second inverse — fewer rounding errors.
- Check validity: triangle inequality on the sides, angle sum on the angles, and biggest side opposite biggest angle.
Area from Two Sides and the Included Angle, Worked
For a = 7, b = 10, C = 60° (the SAS example above): Area = ½ × 7 × 10 × sin(60°) = 35 × 0.8660 ≈ 30.31. Once any case is solved, you always have at least one SAS pair available, so the area is always computable.
The Circumradius Connection
The extended Law of Sines says a/sin(A) = 2R, where R is the circumradius. For the 3-4-5 triangle: 5/sin(90°) = 5 = 2R, so R = 2.5 — matching the right-triangle result R = c/2. The two pages' formulas agree, as they must.