Triangle Trigonometry: SSS, SAS, ASA and Beyond
Law of sines, law of cosines, Heron's formula and the five classical triangle-solving cases, with worked examples and the math you need.
What a Triangle Solver Does
Hand a triangle three measurements and ask for the missing parts. If you picked your three measurements carefully, you can find every side, every angle, the perimeter, and the area. If you picked them carelessly, you might get two valid triangles, or none.
The rules behind this go back to Greek geometry and 9th-century Persian trigonometry, and they boil down to two laws and a handful of shortcuts. This guide walks through what to enter, which law solves each case, where the ambiguous case bites, and how to use the result for real-world jobs like sizing a roof rafter or laying out a square corner without a protractor.
You Need Three Things, and One Must Be a Side
A triangle has six measurements: three sides (a, b, c) and three angles (A, B, C). To define a unique triangle you need three of them, and at least one must be a length. Three angles alone describe shape but not size. A 60-60-60 triangle can be a postage stamp or a billboard.
The five classical "cases" cover every combination of three you can pick:
| Case | What you know | How the solver finds the rest |
|---|---|---|
| SSS | All three sides | Law of Cosines for each angle |
| SAS | Two sides and the angle between them | Law of Cosines for the third side, then Law of Sines for the remaining angles |
| ASA | Two angles and the side between them | Third angle by subtraction (angles sum to 180°), then Law of Sines |
| AAS | Two angles and a side not between them | Same as ASA |
| SSA | Two sides and a non-included angle | The ambiguous case. May produce 0, 1, or 2 valid triangles |
The Two Laws That Run the Show
The Law of Sines: in any triangle, the ratio of a side to the sine of its opposite angle stays constant.
a / sin A = b / sin B = c / sin C
The Law of Cosines: the generalization of the Pythagorean theorem to any triangle.
c² = a² + b² − 2ab·cos(C)
When C is 90°, cos(C) is zero, and the Law of Cosines collapses to a² + b² = c², which is the Pythagorean theorem you saw in school. The right triangle is a special case, not a separate rule.
The most famous triangle in mathematics
Sides 3, 4, and 5 form a right triangle because 3² + 4² = 9 + 16 = 25 = 5². The 3-4-5 is the smallest Pythagorean triple, and builders used it to lay out right angles for thousands of years before anyone had a protractor. Egyptian rope stretchers knotted a loop with 3-4-5 spacing and used it to square pyramid foundations.
| Property | Value |
|---|---|
| Sides | a = 3, b = 4, c = 5 |
| Angles | A = 36.87°, B = 53.13°, C = 90° |
| Area | 6 (½ × base × height) |
| Perimeter | 12 |
Other useful Pythagorean triples: 5-12-13, 8-15-17, 7-24-25, 20-21-29. Any integer multiple of a triple is also a triple. 6-8-10 (twice 3-4-5) still squares a corner.
How to Measure a Triangle Without a Protractor
If you only have a tape measure, measure all three sides and feed them to the solver as a, b, c. The Law of Cosines gives you every angle:
cos(A) = (b² + c² − a²) / (2bc)
This is how surveyors worked for centuries before laser theodolites. It is also how a CNC machinist can verify the angles of a milled bracket using only a caliper. Walk through the formula once on a 5-7-8 triangle:
- cos(A) = (49 + 64 − 25) / (2 × 7 × 8) = 88 / 112 = 0.7857
- A = arccos(0.7857) = 38.21°
- cos(B) = (25 + 64 − 49) / (2 × 5 × 8) = 40 / 80 = 0.5
- B = arccos(0.5) = 60°
- C = 180 − 38.21 − 60 = 81.79°
Three tape-measure values, three angles, no protractor.
The Ambiguous Case (SSA): Why You Might Get Two Answers
SSA is the troublemaker. If you know two sides and an angle that is not between them, you sometimes get two valid triangles, one valid triangle, or none. Picture a hinged door: side a swings from the corner with angle A. Depending on the length of side b, the door can close into one of two positions, one position, or miss the wall entirely.
The solver in this site reports the most likely solution. If your input describes a situation where two solutions exist, the second triangle uses the supplementary angle (180° minus the first angle). Plug it in and check whether it makes physical sense for your problem.
Area: Three Formulas for Three Situations
| Formula | Use when |
|---|---|
| Area = ½ × base × height | You know a side and the perpendicular height to it |
| Area = ½ × a × b × sin(C) | You know two sides and the angle between them (SAS) |
| Area = √[s(s−a)(s−b)(s−c)], s = (a+b+c)/2 | You know all three sides (Heron's formula) |
Heron's formula is the most useful of the three. Give it three sides; it returns the area with no need for any angle or height. The solver runs Heron's automatically once it has all three sides.
Worked Example: Sizing a Roof Rafter
From rise and run to the cut list
A rafter rises 4 m vertically over a horizontal run of 6 m. What is the pitch angle and how long is the rafter?
This is a right triangle with the two legs known. Side a = 4 (rise), side b = 6 (run), angle C = 90° (where the rise and run meet). The solver returns:
- Rafter length (hypotenuse): c = √(4² + 6²) = √52 ≈ 7.21 m
- Pitch angle (between rafter and run): A = arctan(4/6) ≈ 33.69°
- Cross-section area of the gable: 12 m² (rise × run / 2)
The same trick works for ramps, staircase rises, and any rise-over-run problem. The solver calls them "side a" and "side b," but they are whatever orthogonal measurements you have.
Special Triangles to Recognize on Sight
- Equilateral: all sides equal, all angles 60°. The most symmetric triangle. Area = (√3 / 4) × side².
- Isosceles: two sides equal, two angles equal. The equal angles sit opposite the equal sides.
- Scalene: all sides different, all angles different.
- Right: one angle is 90°. The Pythagorean theorem applies.
- 30-60-90: sides in ratio 1 : √3 : 2. Shows up everywhere in trigonometry.
- 45-45-90 (isosceles right): sides in ratio 1 : 1 : √2. The shape of half a square.
Where Triangle Math Earns Its Keep
- Surveying and GPS. Triangulation pinpoints a position from known reference points. Your phone uses the same idea with cell towers and satellites.
- Architecture and construction. Trusses, roof angles, staircase rise/run, structural load distribution. Every hip roof in your neighborhood passed through the Law of Cosines.
- Astronomy. Stellar parallax measures distance to nearby stars by triangulating from Earth's position six months apart, with Earth's orbit forming the baseline.
- Computer graphics. Every 3D model you have seen, from Pixar films to video games, is built from millions of triangles. A triangle mesh is the standard representation.
- Navigation. The Law of Cosines, applied on a sphere instead of a plane, becomes the great-circle distance formula behind GPS and aviation.
Frequently Asked Questions
What's a "trig" triangle calculator?
"Trig" is shorthand for trigonometry. A trig triangle calculator solves any triangle (not only right triangles) using the Law of Sines and Law of Cosines. The Pythagorean theorem is one special case of the Law of Cosines, used when one angle equals 90°.
How do I measure a triangle without a protractor?
Measure all three sides with a tape measure. Enter them as a, b, c. The Law of Cosines gives you every angle without needing a protractor. Surveyors did this for centuries.
Why does the SSA case sometimes have two answers?
When you know two sides and an angle that is not between them, the third side has two possible lengths in some configurations. Picture a hinged segment that can close into the triangle from two directions. Plug both candidates into your real-world problem and see which one fits.
How do I calculate triangle area without knowing the height?
Use Heron's formula. If you know all three sides a, b, c, compute s = (a + b + c) / 2 and then Area = √[s(s−a)(s−b)(s−c)]. The solver does this automatically once you provide all three sides.
What's the difference between a triangle solver and a Pythagorean calculator?
A Pythagorean calculator handles only right triangles, where one angle is 90°. A triangle solver handles right, acute, and obtuse triangles with the more general Law of Sines and Law of Cosines. The right-triangle case is one branch inside the general solver.
Can three angles define a triangle?
No. Three angles fix the shape but not the size. Two equilateral triangles with angles 60-60-60 can be a millimeter wide or a kilometer wide. You must give at least one side length.
What does "the triangle inequality" mean?
For any triangle, the sum of any two sides must be greater than the third side. If you enter 2, 3, and 10, no triangle exists, because 2 + 3 cannot reach 10. The solver returns an error in that case.
Further Reading
- Wikipedia: Solution of Triangles. Full mathematical treatment including derivations.
- Wikipedia: Law of Sines and Law of Cosines. The foundational identities.
- Heron's formula. Compute area from three sides, no height needed.
- Percentages, Mastered. Another foundational math guide on the site.
- Triangle Calculator. Plug in three measurements and see the math run.