Law of Sines & Cosines Calculator
- Law of cosines for angle A: cos A = (b² + c² − a²) ÷ (2bc) = 0.8, so A = 36.87°.
- The same step for B gives 53.13°, and the angles must total 180°, so C = 180 − 36.87 − 53.13 = 90.00°.
- Area = ½ × a × b × sin C = ½ × 3.00 × 4.00 × sin 90.00° = 6.00 square units, and the perimeter is 12.00.
A law of sines and cosines calculator solves any triangle when you know three of its six parts (three sides and three angles). Enter three known values—whether SSS (three sides), SAS (two sides and the included angle), or SSA (two sides and a non-included angle)—and the tool returns every missing side, every missing angle, and the total area. The law of cosines, c² = a² + b² − 2ab·cos C, generalises Pythagoras to any triangle, while the law of sines says each side divided by the sine of its opposite angle equals one constant. In every solved triangle the angles sum to 180° and area = ½ × a × b × sin C. For SSS with sides 3, 4, and 5, the result is angles 36.87°, 53.13°, and 90.00° with area 6.00. For SAS with sides a = 5 and c = 8 with included angle B = 60°, the result is b = 7 exactly, angles 38.21° and 81.79°, and area 17.32. The SSA case can be ambiguous: a = 8, b = 10, and A = 30° produces two valid triangles—one with B = 38.68° and c = 14.91, another with B = 141.32° and c = 2.42. SSA can also produce exactly one triangle (when sin B = 1 or the second angle leaves no room) or none at all (when sin B would exceed 1).
These two laws are the accepted standard for triangle calculation because together they cover every possible combination of known sides and angles without approximation or guesswork. The law of cosines handles cases where no angle is known, while the law of sines efficiently fills in the remaining values once one angle-side pair is established. This page shows the formula, step-by-step workings, worked examples, and sources so you can verify each result yourself.
Worked examples
The 3-4-5 triangle (SSS)
Primary result: area 6.00 — angles 36.87°, 53.13° and exactly 90°. (SSS — all three sides · 3 · 4 · 5 · 30 ° · 60 ° · 75 °)
| Area | 6.00 |
| Side a | 3.00 |
| Side b | 4.00 |
| Side c | 5.00 |
| Angle A | 36.87° |
| Angle B | 53.13° |
| Angle C | 90.00° |
| Perimeter | 12.00 |
SAS with a 60° included angle
Primary result: area 17.32 — the missing side works out to exactly 7. (SAS — sides a & c with included angle B · 5 · 7 · 8 · 30 ° · 60 ° · 75 °)
| Area | 17.32 |
| Side a | 5.00 |
| Side b | 7.00 |
| Side c | 8.00 |
| Angle A | 38.21° |
| Angle B | 60.00° |
| Angle C | 81.79° |
| Perimeter | 20.00 |
The ambiguous case (SSA)
Primary result: side c = 14.91 in solution 1 — and a second valid triangle with c = 2.42. (SSA — sides a & b with angle A (ambiguous) · 8 · 10 · 5 · 30 ° · 60 ° · 75 °)
| Side c (solution 1) | 14.91 |
| Angle B (solution 1) | 38.68° |
| Angle C (solution 1) | 111.32° |
| Second solution — angle B | 141.32° |
| Second solution — angle C | 8.68° |
| Second solution — side c | 2.42 |
| Area (solution 1) | 37.26 |
The two laws, in plain terms
The law of cosines, written as c² = a² + b² − 2ab·cos C, generalises Pythagoras to any triangle. If angle C happens to be 90°, the cosine term drops to zero and the formula collapses to c² = a² + b² — the Pythagorean theorem you already know. The law of sines takes a different shape: each side divided by the sine of its opposite angle equals one constant. In a right triangle that constant is simply the hypotenuse, which is why both laws reduce cleanly to right-triangle trigonometry in the special case.
Reach for the law of cosines when you know two sides and the angle squeezed between them (SAS), or when you know all three sides (SSS). Reach for the law of sines when you know two angles and a side (ASA or AAS), since a second angle pins the triangle down. A good law of sines and cosines calculator applies both so you do not have to guess which one fits your inputs.
The SSA case is the one to watch. Given a = 8, b = 10, and A = 30°, two valid triangles emerge: B = 38.68° with c = 14.91, or B = 141.32° with c = 2.42. SSA can also produce exactly one triangle — when sin B = 1 or the second angle leaves no room — or none at all, when sin B would exceed 1.
Whatever path you take, two facts hold in every solved triangle: the angles sum to 180°, and the area equals ½ × a × b × sin C. The verified examples confirm this. For SSS with sides 3, 4, 5, the angles come out 36.87°, 53.13°, and 90.00° with area 6.00 — the classic right triangle recovered from sides alone. For SAS with sides a = 5 and c = 8 and included angle B = 60°, the missing side b is exactly 7, the other angles are 38.21° and 81.79°, and the area is 17.32.
Worked examples
The worked examples below show exactly what a law of sines and cosines calculator returns for the three cases you will meet most often. In every solved triangle the angles sum to 180° and area = ½ × a × b × sin C, so you can check any result by confirming both rules hold. The law of cosines, c² = a² + b² − 2ab·cos C, generalises Pythagoras to any triangle, while the law of sines says each side divided by the sine of its opposite angle equals one constant.
The first row is the SSS case, where you know all three sides and nothing else. Feeding sides 3, 4, and 5 into the calculator returns angles 36.87°, 53.13°, and 90.00° with an area of 6.00 — the classic right triangle recovered from sides alone. The second row is the SAS case, where you know two sides and the angle squeezed between them. With sides a = 5 and c = 8 and included angle B = 60°, the calculator gives b = 7 exactly, remaining angles of 38.21° and 81.79°, and area 17.32.
The third row is the SSA case, also called the ambiguous case, and it is the one that surprises people. With a = 8, b = 10, and A = 30°, the data produce two valid triangles: one with B = 38.68° and c = 14.91, and a second with B = 141.32° and c = 2.42. A good law of sines and cosines calculator must list both solutions, because a single answer here would hide half the story.
The same SSA setup can also produce exactly one triangle — when sin B = 1 or the second angle leaves no room — or none at all, when sin B would exceed 1. That is why the table below labels the SSA row with two outcome columns instead of one: it mirrors the way the ambiguous case actually behaves.
| Case | Given | Solved side(s) | Solved angle(s) | Area |
|---|---|---|---|---|
| SSS | Sides 3, 4, 5 | — | 36.87°, 53.13°, 90.00° | 6.00 |
| SAS | a = 5, c = 8, B = 60° | b = 7 | 38.21°, 81.79° | 17.32 |
| SSA (solution 1) | a = 8, b = 10, A = 30° | c = 14.91 | B = 38.68° | — |
| SSA (solution 2) | a = 8, b = 10, A = 30° | c = 2.42 | B = 141.32° | — |
SSS and SAS: starting from sides
When you already know all three sides (SSS) or two sides plus the angle between them (SAS), a law of sines and cosines calculator starts with the law of cosines. That formula, c² = a² + b² − 2ab·cos C, generalises Pythagoras to any triangle, so you can solve for an angle even when no right angle is present. Once one angle is known, the law of sines says each side divided by the sine of its opposite angle equals one constant, which makes finding the remaining angles straightforward.
Consider the classic 3-4-5 triangle entered as an SSS case. Plugging the sides into the law of cosines gives angles of 36.87°, 53.13°, and 90.00°, with an area of 6.00. The angle-sum check confirms the result: 36.87 + 53.13 + 90.00 equals exactly 180°, and the area formula ½ × a × b × sin C yields 6.00. The right triangle is recovered from sides alone, with no prior knowledge of the 90° angle required.
The SAS case works similarly but in a different order. Given sides a = 5 and c = 8 with the included angle B = 60°, the law of cosines first produces the third side, b = 7 exactly. From there the remaining angles fall out as 38.21° and 81.79°. The angle-sum check holds: 38.21 + 81.79 + 60.00 = 180°, and the area of 17.32 matches ½ × a × b × sin C. In every solved triangle the angles sum to 180° and area = ½ × a × b × sin C, so these two identities serve as a built-in verification step.
SSS and SAS are the cleanest configurations because each set of inputs maps to exactly one triangle. The same cannot be said for SSA, the ambiguous case. For example, a = 8, b = 10, and A = 30° produces two valid triangles — B = 38.68° with c = 14.91, or B = 141.32° with c = 2.42. SSA can also produce exactly one triangle, when sin B = 1 or the second angle leaves no room, or none at all when sin B would exceed 1. This is why a reliable calculator distinguishes among SSS, SAS, and SSA rather than treating every side-and-angle combination the same way.
ASA: starting from angles
When you know two angles and the side between them — the ASA case — the law of sines and cosines calculator handles the problem in two clean steps. First, it finds the third angle using the fact that every triangle's angles sum to 180°. If you enter angles A and B, the calculator subtracts both from 180° to get angle C. No law is needed for that step; it is simple arithmetic that narrows the unknowns down to two missing sides.
With all three angles now known and one side already given, the calculator applies the law of sines. That law says each side divided by the sine of its opposite angle equals one constant. So if the known side is a, the ratio a / sin A is computed first, and the same constant is then used to solve for the other two sides: b equals that constant times sin B, and c equals it times sin C. Because every angle in the triangle is already fixed, there is no ambiguity — each missing side has exactly one value.
This is what makes ASA straightforward compared with trickier cases. The included side anchors the ratio, and the known angles leave no room for a second possible triangle. The result is a single, fully determined triangle with sides, angles, and area all computed from the given data.
- Step 1: Find the third angle by subtracting the two known angles from 180°
- Step 2: Compute the constant ratio by dividing the known side by the sine of its opposite angle
- Step 3: Multiply that constant by the sine of each remaining angle to get the two missing sides
The ambiguous case (SSA), honestly
When you feed two sides and a non-included angle into a law of sines and cosines calculator, the math sometimes refuses to give you a single tidy answer. The so-called SSA arrangement — side, side, angle — is notorious because the known angle does not sit between the two known sides. Picture the side opposite the known angle as a rod pinned at one end, free to swing. Depending on how long the other known side is, that rod can reach across and touch the baseline in two different spots, creating two distinct triangles from the same starting data.
A verified example makes this concrete. Take side a = 8, side b = 10, and angle A = 30°. The law of sines says each side divided by the sine of its opposite angle equals one constant, so sin B works out to (10 × sin 30°) / 8, which is 0.625. The inverse sine of 0.625 is 38.68°, but 180° − 38.68° also has a sine of 0.625, giving a second candidate: B = 141.32°. Both are legitimate because each leaves enough room for the third angle to keep the total at 180°. The first triangle finishes with C = 111.32° and side c = 14.91; the second finishes with C = 8.68° and side c = 2.42. Same three givens, two different triangles.
The swinging-side picture also shows why SSA does not always produce two answers. If the free side is just long enough to graze the baseline at exactly one point, the triangle is a right triangle and sin B equals 1 — one solution. If the second candidate angle is so large that no degrees remain for the third angle, you are back to one solution as well. And if the free side is too short to reach the baseline at all, sin B would have to exceed 1, which is impossible — no triangle exists.
This is why a trustworthy calculator does not simply spit out one result and move on. It checks whether the data allow zero, one, or two triangles, and when two are possible it shows both complete sets of angles and sides. In every solved triangle the angles sum to 180° and the area equals ½ × a × b × sin C, so you can verify each candidate independently.
Checking a solved triangle
Once your law of sines and cosines calculator returns results, a few quick checks confirm the triangle is valid before you rely on the numbers. The most basic test is angle sum: in every solved triangle, the three angles add up to exactly 180°. If your angles total 179° or 181° after rounding, that is acceptable, but a larger gap signals an error in data entry or calculation. For example, the verified SSS case with sides 3, 4, and 5 produces angles of 36.87°, 53.13°, and 90.00°, which sum to 180° exactly and recover the classic right triangle from sides alone.
A second check uses the law of sines, which says each side divided by the sine of its opposite angle equals one constant. That constant should match for all three side-angle pairs. The law of cosines, expressed as c² = a² + b² − 2ab·cos C, generalises Pythagoras to any triangle, and together these two rules govern every solution a calculator produces. For the verified SAS case with sides a = 5 and c = 8 and included angle B = 60°, the result is b = 7 exactly, with angles 38.21° and 81.79°, and area 17.32. Each side divided by the sine of its opposite angle yields the same value, confirming the triangle closes properly.
A third structural check is that the largest side sits opposite the largest angle, and the smallest side opposite the smallest angle. If a calculator shows a long side paired with a small angle, something is wrong. This check is especially useful in the ambiguous SSA case, where a = 8, b = 10, and A = 30° produces two valid triangles: one with B = 38.68° and c = 14.91, and another with B = 141.32° and c = 2.42. Both solutions satisfy the angle-sum rule and the law-of-sines constant, yet they represent different shapes, which is why SSA is called the ambiguous case.
SSA can also produce exactly one triangle when sin B = 1 or when the second angle leaves no room for a third, or none at all when sin B would exceed 1. Knowing which outcome applies helps you interpret what the calculator returns. In every solved triangle, the area equals ½ × a × b × sin C, giving you one more value to verify against the calculator's output.
- Angles must sum to 180°
- Side divided by sine of opposite angle equals one constant for all three pairs
- Largest side opposite largest angle
- Area equals ½ × a × b × sin C
FAQs
When do I use the law of cosines instead of the law of sines?
Use the law of cosines when you know two sides and the included angle, or when you know all three sides. Use the law of sines when you know a side and its opposite angle. Choosing the right rule depends on which measurements you already have.
What are the angles of a 3-4-5 triangle?
A 3-4-5 triangle has angles of 36.87°, 53.13° and 90.00°. Because one angle is exactly 90 degrees, it is a right triangle. Its area is 6.00, which you can verify by multiplying the two shorter sides and dividing by two.
Why does SSA sometimes give two answers?
Because sin B can come from an acute or an obtuse angle, the SSA case can produce two valid triangles. For example, a = 8, b = 10, A = 30° fits both B = 38.68° (c = 14.91) and B = 141.32° (c = 2.42). Always check whether a second solution exists.
Can SSA give no triangle at all?
Yes. If b × sin A ÷ a exceeds 1, side b is too short to reach the base and no triangle exists. In that case the given measurements cannot form a valid triangle, so there is no solution to calculate. Always check this condition before solving.
How do I find the area of a solved triangle?
Use the formula Area = ½ × a × b × sin C. For a SAS example with a = 5, c = 8, B = 60°, the area is 17.32. This formula works whenever you know two sides and the included angle, giving you the area directly.
Do the angles of every triangle sum to 180°?
Yes in Euclidean geometry. The three angles always total 180°, which is the quickest check on any solved triangle, including both SSA solutions. If your calculated angles do not sum to 180°, review your work for an error.