Triangle calculator: solve SSS, SAS, ASA, AAS and SSA

Missing sides, angles, area, perimeter, heights, inradius and circumradius of any triangle from three measurements, with both SSA answers.

Drafted with AI writing toolsUpdated Checked examples: 8

Try
Area
cm²
Area: 26.8328 cm²
Maximum decimal places: 4; Nearest, ties away from zero
Side a
7cm
Side b
8cm
Side c
9cm
Angle A
48.1897°
Angle B
58.4119°
Angle C
73.3985°
Perimeter
24cm
Inradius
2.2361cm
Circumradius
4.6957cm
Height onto a
7.6665cm
Height onto b
6.7082cm
Height onto c
5.9628cm
Type
Scalene, acute
Number of triangles
1

The triangle has sides 7, 8 and 9 cm with angles 48.1897°, 58.4119° and 73.3985°; it is Scalene, acute and encloses 26.8328 cm².

The triangle, to scale

c = 9 cma = 7 cmb = 8 cm48.19°58.41°73.4°ABC
How it's calculated S
  1. Law of cosines for each angle

    cos⁡A=b2+c2−a22bc=0.666667⇒A=48.189685∘cos⁡B=a2+c2−b22ac=0.52381⇒B=58.411864∘cos⁡C=a2+b2−c22ab=0.285714⇒C=73.39845∘\begin{gathered} \cos A = \frac{b^2 + c^2 - a^2}{2bc} = 0.666667 \Rightarrow A = 48.189685^\circ \\[6pt] \cos B = \frac{a^2 + c^2 - b^2}{2ac} = 0.52381 \Rightarrow B = 58.411864^\circ \\[6pt] \cos C = \frac{a^2 + b^2 - c^2}{2ab} = 0.285714 \Rightarrow C = 73.39845^\circ \end{gathered}
  2. Area

    Δ=12absin⁡C=12×7×8×sin⁡73.39845∘=26.832816 cm2\Delta = \tfrac{1}{2}ab\sin C = \tfrac{1}{2} \times 7 \times 8 \times \sin 73.39845^\circ = 26.832816\,\text{cm}^{2}
  3. Inradius and circumradius

    r=Δs=26.83281612=2.236068 cmR=a2sin⁡A=4.695743 cm\begin{gathered} r = \frac{\Delta}{s} = \frac{26.832816}{12} = 2.236068\,\text{cm} \\[6pt] R = \frac{a}{2\sin A} = 4.695743\,\text{cm} \end{gathered}

    Δ is the area and s is the semi-perimeter.

  4. Heights

    ha=2 Δa=7.666519 cmhb=2 Δb=6.708204 cm,hc=2 Δc=5.962848 cm\begin{gathered} h_a = \frac{2\,\Delta}{a} = 7.666519\,\text{cm} \\[6pt] h_b = \frac{2\,\Delta}{b} = 6.708204\,\text{cm},\quad h_c = \frac{2\,\Delta}{c} = 5.962848\,\text{cm} \end{gathered}

About the triangle calculator

Three compatible measurements can determine a triangle when at least one is a side; the SSA case may have two solutions. The law of cosines, c² = a² + b² − 2ab cos C, solves three sides (SSS) and two sides with the angle between them (SAS). The law of sines, a/sin A = b/sin B = c/sin C, solves two angles and a side (ASA, AAS). The area comes from ½ab sin C, and the results add the perimeter, all three heights, the inradius and the circumradius.

The default sides of 7, 8 and 9 cm give angles of 48.19°, 58.41° and 73.40° and an area of 26.8328 cm². Surveying and roof framing use the same two laws to find a length that cannot be measured directly from ones that can.

Two sides and an angle that is not between them (SSA) can fit two triangles, one or none. With a = 6, b = 8 and A = 35°, both B = 49.89° and B = 130.11° work, so both triangles are drawn and compared in a table.

How to solve a triangle with the law of sines and cosines

Use the law of cosines, c² = a² + b² − 2ab cos C, for three sides or two sides and the angle between them. Use the law of sines, a/sin A = b/sin B = c/sin C, for two angles and a side. Sides of 5 and 7 cm at 49° leave a third side of 5.298667 cm.

Which law to use for SSS, SAS, ASA, AAS and SSA

Lowercase a, b and c are sides, and A, B and C are the angles opposite them, so side a faces angle A.

  • SSS, three sides: each angle comes from the law of cosines rearranged, cos A = (b² + c² − a²)/(2bc).
  • SAS, two sides and the angle between them: the law of cosines gives the third side, then the other angles follow.
  • ASA or AAS, two angles and a side: the third angle is 180° minus the other two, and the law of sines gives the missing sides.
  • SSA, two sides and an angle opposite one of them: the law of sines gives sin B, which two different angles share, so there may be two triangles, one or none.

The angles of a triangle always add to 180°. With A = 40° and B = 60°, C = 80°; if the side between them is c = 10 cm, then a = 10 sin 40°/sin 80° ≈ 6.527036 cm and b = 10 sin 60°/sin 80° ≈ 8.793852 cm.

Two angles fix a triangle's shape but not its size, so at least one side is always needed. The largest angle sits opposite the longest side.

Area of a triangle without the height

From two sides and the angle between them, area = ½ab sin C. The 5 cm and 7 cm sides at 49° enclose ½ × 5 × 7 × sin 49° ≈ 13.207418 cm².

From three sides, Heron's formula needs no angles: with s = (a + b + c)/2, area = √(s(s − a)(s − b)(s − c)). Sides of 7, 8 and 9 cm give s = 12 and √(12 × 5 × 4 × 3) = √720 ≈ 26.832816 cm².

When a base and its perpendicular height are known, area = ½bh; the area and perimeter calculator has that form.

Area of an equilateral triangle

An equilateral triangle with side x has three 60° angles, height (√3/2)x ≈ 0.866x and area (√3/4)x² ≈ 0.433x². A side of 5 cm gives a height of about 4.330127 cm and an area of about 10.825318 cm².

Side, cmHeight, cmArea, cm²Perimeter, cm
10.8660250.4330133
21.7320511.7320516
32.5980763.8971149
43.4641026.92820312
54.33012710.82531815
65.19615215.58845718
86.92820327.71281324
108.66025443.3012730
1210.39230562.35382936

Doubling the side doubles the perimeter and multiplies the area by four: 10 cm sides enclose 43.30127 cm², four times the 5 cm triangle.

Area of an isosceles triangle

With two equal legs L and a base b, the height from the apex cuts the base in half: h = √(L² − (b/2)²), and area = bh/2. Legs of 5 cm on a 6 cm base give h = √(25 − 9) = 4 cm and an area of 12 cm².

The two base angles are equal, about 53.130102° each in that triangle, which leaves about 73.739795° at the apex.

Equal leg, cmBase, cmHeight, cmArea, cm²Perimeter, cm
5641216
5831218
101284832
1310126036
132456050
17161512050

Every height in this chart is a whole number because each half-triangle is a Pythagorean triple, such as 3-4-5 or 5-12-13. The base must be shorter than twice the leg; at exactly 2L the triangle flattens to zero area.

Worked examples for each case

Sides are in centimeters, angles in degrees and areas in square centimeters.

ModeEntered measurementsSide c, cmArea, cm²Solutions
SSSa=7, b=8, c=9926.8328161
SASa=5, b=7, C=49°5.29866713.2074181
ASAA=40°, B=60°, c=101028.2628971
AASA=30°, B=45°, a=1019.31851768.301271
SSAA=35°, a=6, b=810.41904723.9044792

Why SSA can give two triangles

For an acute angle A, compare side a with the height h = b sin A, the distance from corner C to the line that side c lies on:

  • a < h: no triangle, because side a cannot reach.
  • a = h: exactly one right triangle.
  • h < a < b: two triangles, one with an acute angle B and one with an obtuse B.
  • a ≥ b: one triangle.

When A is 90° or more, a triangle exists only if a is longer than b, and then there is one.

For a = 6 cm, b = 8 cm and A = 35°, h = 8 sin 35° ≈ 4.588611 cm. Since 4.59 < 6 < 8, two triangles fit: sin B = 8 sin 35°/6 ≈ 0.764769, so B ≈ 49.886408° or its supplement, 130.113592°.

TriangleAngle B, °Angle C, °Side c, cmArea, cm²
149.88640895.11359210.41904723.904479
2130.11359214.8864082.6873866.165685

Both triangles fit every given measurement, so both are answers unless the problem adds a condition, such as B being obtuse.

Shorten a to 4 cm and it falls below h, so no triangle closes. Lengthen it to 9 cm and only one fits, with B ≈ 30.653554°.

Common mistakes

  • Calling a non-included angle SAS. SAS needs the angle between the two known sides; an angle opposite one of them makes the problem SSA.
  • Stopping at the first SSA answer. The supplement of B is a second solution whenever h < a < b.
  • Using a slanted leg as the height. For the 5-5-6 isosceles triangle, 6 × 5/2 = 15 cm² overstates the true 12 cm².
  • Applying Pythagoras without a right angle. For 7, 8 and 9, 7² + 8² = 113 is not 9² = 81; the law of cosines covers every triangle.
  • A calculator left in radians. sin 49 read as radians is about −0.953753, which wrecks a hand calculation in degrees.

Side labels, units and circle radii

  • Labels: SAS uses angle C between a and b; ASA uses side c between angles A and B; AAS uses side a opposite A; SSA uses a, b and angle A opposite a.
  • Angles: each can be typed in degrees, radians, gradians or turns, and every result angle is reported in degrees.
  • Units: sides can mix units, and area comes out in the square of the result unit. Sides of 3, 4 and 5 in with centimeter results give 30.48 cm of perimeter and 38.7096 cm² of area.
  • Circle radii: the inscribed circle has r = area/s and the circle through the corners has R = a/(2 sin A). The 7-8-9 triangle has r = √5 ≈ 2.236068 cm and R ≈ 4.695743 cm.

When one angle is 90°, the right triangle calculator solves it from any two values.

Worked examples

SSS 3-4-5

I know
SSS
Side a (opposite A)
3 cm
Side b (opposite B)
4 cm
Side c (opposite C)
5 cm
Show results in
Centimetres (cm)
Area
6 cm²
Angle C
90 °
Angle A
36.869898 °
Angle B
53.130102 °
Inradius
1 cm
Circumradius
2.5 cm
Type
Scalene, right
Number of triangles
1

Checked against: Right triangle: area ½·3·4, r = (3 + 4 − 5)/2, R = hypotenuse/2

Equilateral, side 5

I know
SSS
Side a (opposite A)
5 cm
Side b (opposite B)
5 cm
Side c (opposite C)
5 cm
Show results in
Centimetres (cm)
Area
10.825318 cm²
Angle A
60 °
Angle B
60 °
Angle C
60 °
Type
Equilateral
Circumradius
2.886751 cm

Checked against: sqrt(3)/4*25, 5/sqrt(3)

SAS a = 5, b = 7, C = 49°

I know
SAS
Side a (opposite A)
5 cm
Side b (opposite B)
7 cm
Angle C (between a and b)
49 °
Show results in
Centimetres (cm)
Side c
5.298667 cm
Angle A
45.411694 °
Angle B
85.588306 °
Area
13.207418 cm²

Checked against: Law of cosines and ½ab·sin C

ASA A = 40°, c = 10, B = 60°

I know
ASA
Side c (opposite C)
10 cm
Angle A
40 °
Angle B
60 °
Show results in
Centimetres (cm)
Angle C
80 °
Side a
6.527036 cm
Side b
8.793852 cm
Area
28.262897 cm²

Checked against: C = 80°, law of sines a = 10·sin40/sin80

Questions

How do you find a missing side of a triangle that is not right-angled?

With two sides and the angle between them, use the law of cosines: c² = a² + b² − 2ab cos C. For a = 5, b = 7 and C = 49°, c = √(74 − 70 cos 49°) ≈ 5.2987. With two angles and any side, use the law of sines, a/sin A = b/sin B. When C = 90° the cosine term is zero and the law of cosines becomes Pythagoras' theorem.

What is the ambiguous case of the law of sines?

It is the SSA case: two sides and an angle opposite one of them can fit two different triangles. For an acute angle A, find the height h = b sin A. If a < h there is no triangle, if a = h one right triangle, if h < a < b two triangles, and if a ≥ b one. For a = 6, b = 8 and A = 35°, h = 4.589, so B is either 49.89° or 130.11°.

How do you find the angles of a triangle from its three sides?

Rearrange the law of cosines: cos A = (b² + c² − a²)/(2bc), and the same pattern for B and C. For sides 7, 8 and 9, cos A = (64 + 81 − 49)/144 = 0.6667, so A = 48.19°; B = 58.41° and C = 73.40° follow the same way, and the three add up to 180°. The largest angle is always opposite the longest side.

How do you find the area of a triangle without the height?

Take half the product of two sides and the sine of the angle between them: Area = ½ab sin C. Sides 7 and 8 with C = 73.40° give ½ × 7 × 8 × 0.9583 ≈ 26.83. From three sides alone, Heron's formula gives the same answer: the semi-perimeter is 12, and √(12 × 5 × 4 × 3) = √720 ≈ 26.83.

How can you tell if a triangle is acute, right or obtuse from its sides?

Compare the square of the longest side c with the sum of the squares of the other two. If c² < a² + b² the triangle is acute, if they are equal it has a right angle, and if c² is larger it is obtuse. Sides 7, 8 and 9 give 81 < 113, so acute; 3, 4 and 5 give 25 = 25, right; 4, 5 and 8 give 64 > 41, obtuse.

About this calculator

asin⁡A=bsin⁡B=csin⁡C=2R,c2=a2+b2−2abcos⁡CΔ=12absin⁡C,r=Δs\begin{gathered} \frac{a}{\sin A} = \frac{b}{\sin B} = \frac{c}{\sin C} = 2R,\qquad c^2 = a^2 + b^2 - 2ab\cos C \\ \Delta = \tfrac{1}{2}ab\sin C,\qquad r = \frac{\Delta}{s} \end{gathered}

Sources

  1. Weisstein, E. W. “Law of Sines”, “Law of Cosines”, “Triangle” — MathWorld
  2. OpenStax Precalculus 2e, §8.1 Non-right Triangles: Law of Sines (ambiguous case)

Checked against references

This calculator includes 8 worked examples with independently sourced answers. They run in the test suite, and you can run them here too.

Put this calculator on your site

Paste this where you want the calculator to appear. It is free to use, it stays in step with corrections made here, and the credit line below it links back so your readers can find the full version.

Height
Preview the embed

Keep the credit line. It is the only condition, and it is what keeps these calculators free.