Solving a triangle from its three sides
Knowing the three side lengths of a triangle fixes everything else about it: its area, its three angles, its heights and its shape. That is handy in land surveying, carpentry and homework, where sides are easy to measure but angles and heights are not. This calculator applies Heron’s formula and the law of cosines to any triangle, not just right ones.
The formulas
- Semi-perimeter: s = (a + b + c) ÷ 2.
- Area (Heron’s formula): A = √(s × (s − a) × (s − b) × (s − c)).
- Angles (law of cosines): cos(A) = (b² + c² − a²) ÷ (2bc), cos(B) = (a² + c² − b²) ÷ (2ac), and C = 180° − A − B.
- Height on a side: h = 2 × area ÷ that side.
- Inscribed circle radius: r = area ÷ s.
Worked example: sides of 5, 6 and 7
- s = (5 + 6 + 7) ÷ 2 = 9.
- Area = √(9 × 4 × 3 × 2) = √216 = 14.70.
- Angle A = arccos((36 + 49 − 25) ÷ 84) = arccos(0.714) = 44.42°.
- Angle B = arccos((25 + 49 − 36) ÷ 70) = arccos(0.543) = 57.12°.
- Angle C = 180 − 44.42 − 57.12 = 78.46°. All three angles are under 90°: the triangle is acute.
- Perimeter 18, height on side a = 2 × 14.70 ÷ 5 = 5.88, inscribed circle radius 1.63.
How side c changes the triangle (a = 5, b = 6)
| Side c | Area | Angle C |
|---|---|---|
| 2 | 4.68 | 18.19° |
| 4 | 9.92 | 41.41° |
| 6 | 13.64 | 65.38° |
| 7 | 14.70 | 78.46° |
| 7.81 | 15.00 | 90.00° |
| 10 | 11.40 | 130.54° |
The area peaks when the angle between a and b is a right angle, at c = √(5² + 6²) = 7.81, and then shrinks as the triangle flattens.
Types of triangles
- By sides: equilateral (three equal sides, each angle 60°), isosceles (two equal sides and two equal angles) or scalene (all different).
- By angles: acute (all angles below 90°), right (one angle of exactly 90°) or obtuse (one angle above 90°).
A quick test needs no trigonometry: with c the longest side, compare c² to a² + b². Smaller means acute, equal means right, larger means obtuse.
When three lengths do not make a triangle
Each side must be shorter than the sum of the other two. Lengths of 5, 6 and 12 fail because 5 + 6 = 11 is less than 12: the two short sides cannot meet. When the sum is exactly equal, the “triangle” collapses into a straight line with zero area.
Other ways to find the area
- Base and height: area = base × height ÷ 2, the formula to use when you can measure the height directly.
- Two sides and the included angle: area = ½ × a × b × sin(C).
- Coordinates: for corners (x₁, y₁), (x₂, y₂), (x₃, y₃), area = ½ × |x₁(y₂ − y₃) + x₂(y₃ − y₁) + x₃(y₁ − y₂)|.
A practical case: an irregular lot
Surveyors split an irregular piece of land into triangles, measure the sides of each and add up the areas with Heron’s formula. A triangular corner lot with sides of 120, 150 and 180 feet covers about 8,930 square feet, a little over a fifth of an acre.