🧮
🧮 Math & statistics

Law of Sines & Cosines Solver (SAS: two sides & included angle)

Results update as you type.

Your numbers

Understanding the law of sines and cosines solver — concept and principle

When you know two sides of a triangle and the angle between them (the SAS case), the triangle is fixed, and you can find everything else. This solver takes side b, side c and the included angle A, then returns the third side a, the two remaining angles and the area. It is used in surveying, carpentry and navigation whenever there is no right angle to work with.

Triangle with b = 7, c = 9 and included angle 60°Sides 7 and 9 meet at a 60° angle. The law of cosines gives the third side a = √67 ≈ 8.19, then the law of sines gives B ≈ 47.78°, C ≈ 72.22°, and the area is about 27.28.Two sides + the angle between them60°47.8°72.2°ABCc = 9b = 7a = ?a² = 49 + 81 − 63a = √67 ≈ 8.19sin B = 7·sin 60° ÷ aB ≈ 47.78°C = 180° − 60° − BC ≈ 72.22°area = ½·7·9·sin 60°≈ 27.2863 = 2·7·9·cos 60°
The law of cosines closes the gap (side a); the law of sines then finds the angles.

How it is calculated

Angles are entered in degrees and converted to radians internally (multiply by π/180). Sides can be in any unit; side a comes out in the same unit and the area in that unit squared.

The principle

The law of cosines is the Pythagorean theorem with a correction term. Drop a perpendicular from one vertex and apply Pythagoras to the two right triangles it creates; the leftover piece is −2bc cos A. When A = 90°, cos A = 0 and the formula becomes a² = b² + c². When A is acute the third side is shorter than in the right-angle case, and when A is obtuse (cos A < 0) it is longer. The law of sines follows from the area: ½bc sin A = ½ac sin B = ½ab sin C, and dividing each by ½abc gives sin A / a = sin B / b = sin C / c. Its common value equals 1/(2R), where R is the circumradius.

Worked example

  1. Inputs: b = 7, c = 9, A = 60°, so cos A = 0.5 and sin A ≈ 0.866025.
  2. a² = 49 + 81 − 2 × 7 × 9 × 0.5 = 130 − 63 = 67, so a = √67 ≈ 8.185352772.
  3. sin B = 7 × 0.866025 ÷ 8.185353 ≈ 0.740613, so B ≈ 47.78365116°.
  4. C = 180 − 60 − 47.78365 = 72.21634884°.
  5. Area = ½ × 7 × 9 × 0.866025 ≈ 27.27980022.
How Side a (law of cosines) changes with Included angle A (°)How Side a changes with Included angle A2.557.51012.515153045607590120Example: 8.185352772Included angle A (°)
Each point is the calculator re-run with only “Included angle A (°)” changed; the gold point is the default example. Change the inputs above and this chart follows your numbers.
Included angle A (°)Side a (law of cosines)
152.879816989
304.569551304
456.395666155
608.185352772
759.868576408
9011.40175425
12013.89244399

How to read the result

The largest angle is always opposite the longest side: here c = 9 is longest and C ≈ 72.2° is the largest angle, which is a quick sanity check. The angles must add to 180°. A very small a means a thin triangle, where small errors in A matter a lot.

Common mistakes

Keep in mind: This tool finds B with arcsin, which is correct only when B is acute. B is obtuse when b² > a² + c² (side b clearly the longest). In that case use B = 180° − (shown B), or compute the angle opposite the longest side with the law of cosines instead.

Frequently asked questions

When should I use the law of sines instead of the law of cosines?

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

What is the ambiguous case?

With two sides and a non-included angle (SSA), zero, one or two triangles can fit, because sin B = sin(180° − B). SAS never has this problem for side a; only the arcsin step needs care.

Sources: Euclid, Elements, Book II, Propositions 12 and 13 (geometric form of the law of cosines) · I. M. Gelfand and M. Saul, Trigonometry, Birkhäuser

Checked 8 Nov 2026. Standard formulas, computed in your browser with double-precision numbers.

🧮 All math & statistics tools →🌍 Calculators by country →