Triangle Calculator
This triangle calculator solves a triangle from three known parts, at least one of them a side, with the law of sines and the law of cosines. Sides of 7, 8 and 9 give angles of 48.19°, 58.41° and 73.40° and an area of 26.833.
Sources: OpenStax Algebra and Trigonometry 2e Updated
Calculate all properties of a triangle by entering known values. Select your calculation method below based on what information you have.
Select Calculation Method
Which rule finds the missing sides and angles of a triangle
| You know | Case | Start with |
|---|---|---|
| Three sides | SSS | Law of cosines for the angles |
| Two sides and the angle between them | SAS | Law of cosines for the third side |
| Two angles and the side between them | ASA | Angle sum, then the law of sines |
| Two angles and another side | AAS | Angle sum, then the law of sines |
| Two sides and an angle not between them | SSA | Law of sines (may have two answers or none) |
The law of cosines is c² = a² + b² − 2ab cos C. The law of sines is a ÷ sin A = b ÷ sin B = c ÷ sin C.
How to solve a triangle from three sides: 7, 8 and 9
- Check it is a triangle: 7 + 8 = 15 is more than 9.
- Angle A: cos A = (8² + 9² − 7²) ÷ (2 × 8 × 9) = 96 ÷ 144 = 0.6667, so A = 48.19°.
- Angle B: cos B = (7² + 9² − 8²) ÷ (2 × 7 × 9) = 66 ÷ 126 = 0.5238, so B = 58.41°.
- Angle C: 180° − 48.19° − 58.41° = 73.40°.
- Area by Heron's formula: s = (7 + 8 + 9) ÷ 2 = 12, and A = √(12 × 5 × 4 × 3) = √720 ≈ 26.833.
- Perimeter: 7 + 8 + 9 = 24.
With a base and a perpendicular height instead of three sides, the triangle area calculator is quicker. If one angle is 90°, the right triangle calculator uses Pythagoras directly.
Why SSA can have two answers or none
With two sides and an angle that is not between them, the unknown side can sometimes swing to two positions that both fit, or be too short to reach at all.
The calculator shows a "no solution" message when the sine it needs comes out above 1, or when the third angle would be zero or negative. When two triangles fit, it reports one of them, so check the other if your problem allows it.
Reading the diagram
The diagram under the results scales the triangle so its longest side fits in 200 pixels and places C using the angle at A. It is a quick check that the shape looks right, not a measured drawing.
For a shape with more than three corners, enter the coordinates in the polygon area calculator instead.
Questions about solving triangles
How many values do I need to solve a triangle?
Three, and at least one of them must be a side. Three angles fix the shape but not the size, so they are not enough.
When do I use the law of cosines instead of the law of sines?
Use the law of cosines when you know three sides (SSS) or two sides and the angle between them (SAS). Use the law of sines when you know an angle and the side opposite it, as in ASA, AAS and SSA.
Do the angles of a triangle always add up to 180°?
Yes, in a flat triangle. Once two angles are known, the third is 180° minus their sum: 180° − 48.19° − 58.41° = 73.40°.
How do you find the missing side of a triangle?
It depends on what you know. In a right triangle, Pythagoras gives it: c² = a² + b², where c is the side opposite the right angle. With two angles and a side, find the third angle from the 180° sum, then use the law of sines.
With two sides and the angle between them, use the law of cosines. Sides 7 and 8 with 73.40° between them give c² = 7² + 8² − 2 × 7 × 8 × cos 73.40° ≈ 81, so c ≈ 9.
How do you find the height of a triangle?
Double the area and divide by the side you take as the base: h = 2 × area ÷ base. For the triangle with sides 7, 8 and 9, the area is 26.833, so the height onto the side of 9 is 2 × 26.833 ÷ 9 ≈ 5.963. The calculator gives the area, so this works for any triangle it solves.
Sources
- OpenStax Algebra and Trigonometry 2e, 10.1 Non-right Triangles: Law of Sines — the law of sines and the ambiguous SSA case (checked October 16, 2026)
- OpenStax Algebra and Trigonometry 2e, 10.2 Non-right Triangles: Law of Cosines — the law of cosines for SSS and SAS, and Heron's formula (checked October 16, 2026)