Triangle Solver — SSS, SAS, ASA, AAS
Solve any triangle using law of cosines and law of sines. Returns all sides, angles, area, and perimeter.
Triangle formulas
Angle sumA + B + C = 180°
Law of sinesasin A = bsin B = csin C
Law of cosinesc2 = a2 + b2 − 2ab cos C
Angle from three sidescos C = a2 + b2 − c22ab
Area (SAS)Area = ½ ab sin C
Heron's formulaArea = √s(s − a)(s − b)(s − c), s = a + b + c2
Where Side a is opposite angle A, b opposite B, c opposite C
Worked examples
SSS: sides 7, 8 and 9. Find the angles and area.
- cos C = 49 + 64 − 812 × 7 × 8 = 32112 → C ≈ 73.40°
- cos A = 64 + 81 − 492 × 8 × 9 → A ≈ 48.19°
- B = 180° − 73.40° − 48.19° = 58.41°
- s = 12, Area = √12 × 5 × 4 × 3 = √720
Answer: A ≈ 48.19°, B ≈ 58.41°, C ≈ 73.40°, Area ≈ 26.83
ASA: A = 40°, B = 60°, side c = 10. Find the other sides.
- C = 180° − 40° − 60° = 80°
- a = 10 × sin 40°sin 80° ≈ 6.527
- b = 10 × sin 60°sin 80° ≈ 8.794
Answer: C = 80°, a ≈ 6.53, b ≈ 8.79
Tips & common mistakes
- SSA (two sides and a non-included angle) can have two solutions — the "ambiguous case".
- Use the law of cosines first for SSS and SAS, then the law of sines for the rest.
- The longest side is always opposite the largest angle.