Intermediate

Trig Triangle Calculator — Solve Any Triangle (SSS or SAS)

Solve any triangle by entering either three side lengths (SSS) or two sides and the included angle (SAS). The calculator applies the law of cosines to find all missing angles and sides, plus the area (via Heron's formula or the ½ab·sin C formula) and perimeter.

Known values (mode)

Length of side a
Length of side b
Length of side c (SSS mode)
Area
17.4123

Perimeter = 21

Side a
5
Side b
7
Side c
9
Angle A
33.5573°
Angle B
50.7035°
Angle C
95.7392°
Perimeter
21
Semi-perimeter s
10.5
a = 5b = 7c = 9
Triangle: A=33.5573° B=50.7035° C=95.7392°
Step-by-step solution
1

Law of cosines → angle A

A = arccos((b²+c²−a²) / 2bc) = arccos((7²+9²−5²) / (2·7·9)) = 33.5573°
2

Law of cosines → angle B

B = arccos((a²+c²−b²) / 2ac) = 50.7035°
3

Angle C = 180° − A − B

C = 180° − 33.5573° − 50.7035° = 95.7392°
=

Heron's area: s = (a+b+c)/2

s = (5+7+9)/2 = 10.5
Step by step
  1. 1

    Semi-perimeter

    (5 + 7 + 9) ÷ 2 = 10.5
  2. 2

    s(s−a)(s−b)(s−c)

    10.5 × (10.5−5) × (10.5−7) × (10.5−9) = 303.1875
  3. 3

    Area (Heron's formula)

    √(303.1875) = 17.4123
Results are estimates for general information only and are not professional advice — always verify important results independently before relying on them. Read the full disclaimer.
Quick answer

How does this calculator work?

SSS: find each angle with A = arccos((b²+c²−a²)/2bc); area = √(s(s-a)(s-b)(s-c)). SAS: find side c = √(a²+b²−2ab cos C); area = ½ab sin C; remaining angles by law of cosines then A+B+C=180°. Works for any triangle including obtuse. Triangle inequality must hold: each side < sum of the other two.

Formula
Law of cosines: c² = a² + b² − 2ab cos C (and cyclic forms) • Area (SAS) = ½ab sin C • Area (SSS) = √(s(s−a)(s−b)(s−c)) where s = (a+b+c)/2
How this is calculated

The law of cosines generalises the Pythagorean theorem to any triangle. In SSS mode all three angles are found from it: A = arccos((b²+c²−a²) / 2bc), and similarly for B and C. Because arccos always returns a value in [0°, 180°], it is valid for both acute and obtuse angles. The third angle uses the fact that A+B+C = 180°. Area then follows from Heron's formula: Area = √(s(s-a)(s-b)(s-c)) where s is the semi-perimeter.

In SAS mode, the unknown side is found first: c = √(a²+b²−2ab cos C). Then the law of cosines gives angle A, and B = 180°−A−C. Area is ½·a·b·sin C, which avoids the accumulated rounding of the three-angle route. Both methods assume a valid Euclidean triangle: each side must be positive and less than the sum of the other two (triangle inequality); entering values that violate this returns a warning.

This calculator handles any triangle — acute, right or obtuse — but not degenerate cases (collinear points). For right triangles specifically, the Pythagorean theorem and SOH-CAH-TOA are simpler alternatives.

Frequently asked questions

The law of cosines, c² = a²+b²−2ab cos C, relates all three sides and one angle of any triangle. Use it when you know three sides (SSS) or two sides and the included angle (SAS). For two angles and a side (AAS/ASA), the law of sines is usually simpler.

Heron's formula computes triangle area from three sides alone: Area = √(s(s-a)(s-b)(s-c)) where s = (a+b+c)/2 is the semi-perimeter. It is especially useful in SSS mode when you don't have a known angle to use the ½ab sin C formula.

Yes. The law of cosines is valid for any triangle — acute, right or obtuse. An obtuse triangle has one angle > 90°, which makes cos C negative and increases the length of the opposite side compared to the Pythagorean expectation. The arccos function correctly returns angles up to 180°.

Also known as

solve triangle law of cosines
SSS SAS triangle calculator
triangle angle side calculator
oblique triangle solver
law of cosines calculator
triangle area perimeter calculator
triangle sides angles calculator
general triangle solver trig

APA

TG we-Calculate Editorial Team. (2026). Trig Triangle Calculator — Solve Any Triangle (SSS or SAS) [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/trig-triangle-calculator

Chicago

TG we-Calculate Editorial Team. "Trig Triangle Calculator — Solve Any Triangle (SSS or SAS)." TG we-Calculate. 2026. https://we-calculate.com/calculator/trig-triangle-calculator.

IEEE

TG we-Calculate Editorial Team, "Trig Triangle Calculator — Solve Any Triangle (SSS or SAS)," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/trig-triangle-calculator

BibTeX

@misc{wecalculate_trig_triangle_calculator, title = {Trig Triangle Calculator — Solve Any Triangle (SSS or SAS)}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/trig-triangle-calculator}}, year = {2026}, note = {TG we-Calculate} }

Did this calculator help you?