How do I use the law of sines?
Type two angles and a side, or two sides and the angle opposite one of them. The law of sines calculator finds the other sides and angles and the area, and shows both answers when two triangles fit.
- Side c
- 6.52704
The triangle has sides a = 10, b = 12.8558, c = 6.52704 and angles A = 50°, B = 100°, C = 30°.
- Side a
- 10
- Side b
- 12.8558
- Angle A
- 50°
- Angle B
- 100°
- Angle C
- 30°
- Area
- 32.1394
- Triangles
- One triangle
Side c: 6.52704. The triangle has sides a = 10, b = 12.8558, c = 6.52704 and angles A = 50°, B = 100°, C = 30°.
How to calculate
Solves a triangle with the law of sines from two angles and a side (AAS or ASA), or from two sides and an opposite angle (SSA), showing both triangles in the ambiguous case.
Example with the default inputs (What do you know? Two angles and a side, Angle A 50 °, Angle B 100 °, Which side do you know? Side a (opposite A), Length of that side 10): The triangle has sides a = 10, b = 12.8558, c = 6.52704 and angles A = 50°, B = 100°, C = 30°.
Method: Law of sines: a ÷ sin A = b ÷ sin B = c ÷ sin C. Two angles and a side: C = 180° − A − B, then each side = known side ÷ sin(its angle) × sin(the opposite angle). Two sides and angle A: sin B = b sin A ÷ a; B = arcsin, and also 180° − arcsin when A is acute and b sin A < a < b.
- Angles are typed in degrees or radians, each more than 0° and less than 180°.
- Sides are in any one unit, from 10⁻⁹ to 10⁹; the area is in that unit squared.
- Sines at multiples of 15° are exact, and an angle within one part in 10¹² of a multiple of 15° (other than 0°) counts as that multiple.
- In the ambiguous case (two sides and an angle), sin B is taken as 1 when it is within 10⁻¹² of 1, giving one right triangle.
Worked examples
Each example is checked against the calculator on every build.
- What do you know? Two angles and a side, Angle A 50°, Angle B 100°, Which side do you know? Side a (opposite A), Length of that side 10 gives Angle C 30°, Side b 12.855752, Side c 6.527036, Area 32.13938.Source: OpenStax, Algebra and Trigonometry 2e, §10.1 Non-right Triangles: Law of Sines, Example 1 (b ≈ 12.9, c ≈ 6.5), https://openstax.org/books/algebra-and-trigonometry-2e/pages/10-1-non-right-triangles-law-of-sines
- What do you know? Two sides and an angle, Angle A 35°, Side a 6, Side b 8 gives Triangles Two triangles, Angle B 49.89°, Angle C 95.11°, Side c 10.419047, Second triangle: angle B 130.11°, Second triangle: angle C 14.89°, Second triangle: side c 2.687386.Source: OpenStax, Algebra and Trigonometry 2e, §10.1, Example 2 (β ≈ 49.9°, γ ≈ 95.1°, c ≈ 10.4; or β ≈ 130.1°, γ ≈ 14.9°, c ≈ 2.7), https://openstax.org/books/algebra-and-trigonometry-2e/pages/10-1-non-right-triangles-law-of-sines
- What do you know? Two sides and an angle, Angle A 85°, Side a 12, Side b 9 gives Triangles One triangle, Angle B 48.34°, Angle C 46.66°, Side c 8.760321.Source: OpenStax, Algebra and Trigonometry 2e, §10.1, Example 3 (b = 9, c = 12, γ = 85°: β ≈ 48.3°, α ≈ 46.7°, a ≈ 8.8), https://openstax.org/books/algebra-and-trigonometry-2e/pages/10-1-non-right-triangles-law-of-sines
- What do you know? Two sides and an angle, Angle A 30°, Side a 4, Side b 8 gives Triangles One right triangle, Angle B 90°, Angle C 60°, Side c 6.928203.Source: OpenStax, Algebra and Trigonometry 2e, §10.1 (one triangle when the side equals the altitude), https://openstax.org/books/algebra-and-trigonometry-2e/pages/10-1-non-right-triangles-law-of-sines
- What do you know? Two angles and a side, Angle A 45°, Angle B 60°, Which side do you know? Side c (between A and B), Length of that side 10 gives Angle C 75°, Side a 7.320508, Side b 8.965755.Source: OpenStax, Algebra and Trigonometry 2e, §10.1, https://openstax.org/books/algebra-and-trigonometry-2e/pages/10-1-non-right-triangles-law-of-sines
How it works
Label the triangle so that side a is opposite angle A, side b opposite angle B, and side c opposite angle C. The law of sines says
a ÷ sin A = b ÷ sin B = c ÷ sin C, and the angles add up to 180°: A + B + C = 180°.
Two angles and a side (AAS or ASA). Type angles A and B and one side: a (opposite A), b (opposite B), or c (between A and B).
- C = 180° − A − B. There is no triangle if A + B is 180° or more, or within one part in 10¹² of 180° (A + B ≥ π × (1 − 10⁻¹²) radians).
- k = known side ÷ sin(its opposite angle).
- a = k sin A, b = k sin B, c = k sin C.
Two sides and an angle (SSA). Type sides a and b and angle A, opposite side a.
- sin B = b × sin A ÷ a.
- If A is 90° or more (A ≥ π/2 − 10⁻¹² radians): there is one triangle when a > b, with B = arcsin(sin B); otherwise there is no triangle.
- If A is less than 90°, in this order:
- sin B > 1 + 10⁻¹² (a is shorter than the height b sin A): no triangle.
- a ≥ b: one triangle, B = arcsin(sin B), found as B = A − D with sin D = (sin A − sin B)(sin A + sin B) ÷ (sin A cos B + sin B cos A) and sin A − sin B = sin A × (a − b) ÷ a, so a = b gives B = A exactly. (For A of 90° or more, B = arcsin(sin B) directly.)
- a < b and sin B within 10⁻¹² of 1, on either side (a equals the height): one right triangle, B = 90°.
- Otherwise (b sin A < a < b): two triangles, B = arcsin(sin B) and B₂ = 180° − B.
- For each triangle: C = 180° − A − B and c = a × sin C ÷ sin A.
Area = ½ × a × b × sin C, for each triangle.
Shown as typed. The side or sides you type are shown as you typed them; the other sides are k × the sine of their opposite angle, with k = a known side ÷ the sine of its opposite angle.
Small angles keep their digits. Angles are added and subtracted with about 32 digits: π is held as two 64-bit numbers (3.141592653589793 + 1.2246467991473532 × 10⁻¹⁶), the rounding error of each sum is kept, and an angle that counts as a multiple of 15° is that multiple exactly. The sine of an angle over 90° is taken from its supplement (sin C = sin(180° − C)). So a third angle near 0°, or near 180°, keeps its digits. The difference b − a is taken from the decimals you typed, exactly. In the SSA case, the angle between B and A comes from sin(B − A) = (sin B − sin A)(sin B + sin A) ÷ (sin B cos A + sin A cos B), with sin B − sin A = sin A × (b − a) ÷ a; then B = A + (B − A), and in the two-triangle case C₂ = B − A and B₂ = 180° − A − C₂.
Exact sines. The sine of an angle that is a multiple of 15° is taken exactly (sin 30° = 1/2, sin 45° = √2/2, sin 60° = √3/2, sin 75° = (√6 + √2)/4). An angle within one part in 10¹² of a multiple of 15° counts as that multiple, except that no angle is taken as 0°: a tiny angle keeps its own value. Everything else is computed in 64-bit floating point.
Output format. Sides and the area show to 6 significant digits in the unit you typed (the area in that unit squared). Angles show in degrees with up to 2 decimals. "Triangles" says One triangle, One right triangle, or Two triangles; the second triangle's angle B, angle C, side c and area show only in the two-triangle case. The headline is side c.
Assumptions
- Each angle is more than 0° and less than 180°, typed in degrees or radians.
- Each side is from 10⁻⁹ to 10⁹, all in one unit.
- A triangle too small or too large for 64-bit numbers gives no answer, with a message.
Worked examples by hand
AAS: A = 50°, B = 100°, a = 10. C = 180° − 50° − 100° = 30°. k = 10 ÷ sin 50° ≈ 13.0541. b = k sin 100° ≈ 12.8558, c = k × 0.5 ≈ 6.5270. Area = ½ × 10 × 12.8558 × 0.5 ≈ 32.1394. (OpenStax Example 1: b ≈ 12.9, c ≈ 6.5.)
SSA, two triangles: a = 6, b = 8, A = 35°. sin B = 8 × sin 35° ÷ 6 ≈ 0.76476. A is acute and the height 8 sin 35° ≈ 4.589 is less than 6, which is less than 8, so there are two triangles. B ≈ 49.89°, C ≈ 95.11°, c = 6 sin C ÷ sin 35° ≈ 10.419; or B₂ ≈ 130.11°, C₂ ≈ 14.89°, c₂ ≈ 2.687. (OpenStax Example 2.)
SSA, one triangle: a = 12, b = 9, A = 85°. sin B = 9 × sin 85° ÷ 12 ≈ 0.74715, B ≈ 48.34°, C ≈ 46.66°, c = 12 sin C ÷ sin 85° ≈ 8.760. (OpenStax Example 3 names these c, b, γ: a ≈ 8.8.)
SSA, one right triangle: a = 4, b = 8, A = 30°. sin B = 8 × ½ ÷ 4 = 1, so B = 90°, C = 60°, c = 4 × (√3/2) ÷ ½ = 4√3 ≈ 6.9282.
ASA: A = 45°, B = 60°, c = 10. C = 75°, k = 10 ÷ sin 75°. a = 10 × (√2/2) ÷ ((√6 + √2)/4) = 10(√3 − 1) ≈ 7.3205; b = 10 × (√3/2) ÷ sin 75° ≈ 8.9658.
No triangle: a = 4, b = 10, A = 50°. sin B = 10 × sin 50° ÷ 4 ≈ 1.915, more than 1, so no triangle fits.
Other questions people ask
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. Side a is opposite angle A, side b opposite B, and side c opposite C.
When do I use the law of sines instead of the law of cosines?
Use the law of sines when you know an angle and the side opposite it, plus one more part: two angles and a side (AAS or ASA), or two sides and a non-included angle (SSA). With two sides and the angle between them (SAS) or three sides (SSS), use the law of cosines.
What is the ambiguous case?
With two sides a and b and the angle A opposite a (SSA), the parts may fit no triangle, one, or two. If A is acute and a is between the height b × sin A and b, side a can swing to two places, giving two triangles. The calculator shows both.
Why does the calculator say there is no triangle?
In the SSA case, side a may be shorter than the height b × sin A, so it cannot reach the third side; or angle A is 90° or more and a is not the longest side. With two angles, they may add up to 180° or more, leaving no room for the third angle.
Does the law of sines work for right triangles?
Yes. With C = 90°, sin C = 1, so a ÷ sin A = c, which gives sin A = a ÷ c, the usual opposite ÷ hypotenuse.
How is the area found?
Area = ½ × a × b × sin C, half the product of two sides and the sine of the angle between them. For the 50°, 100°, 30° triangle with a = 10, the area is about 32.14 square units.