StringMash.com

Triangle calculator

Any three sides or angles in, the whole triangle out: every side and angle, the area, the heights and the working, drawn to scale.

Solve a triangle

Type any three values, at least one a side, and leave the rest empty. Side a faces angle A. Roots like 5√2 work, and so does π/3 in radians.

Solved from three sides (SSS).

Triangle with a = 7, b = 8, c = 9, drawn to scaleA 48.2°B 58.4°C 73.4°a = 7b = 8c = 9
Scalene acute triangle. Drawn to scale; the dashed line is the height from C.
PartValueExact
Side a given7
Side b given8
Side c given9
Angle A48.1897°
Angle B58.4119°
Angle C73.3985°
Area26.832812√5
Perimeter24
Semiperimeter s12
Height to a (h_a)7.666524√5/7
Height to b (h_b)6.70823√5
Height to c (h_c)5.96288√5/3
Inradius r2.2361√5
Circumradius R4.695721√5/10
Working
  1. Law of cosines. cos C = (a² + b² − c²) / (2ab) = (7² + 8² − 9²) / (2 × 7 × 8) = 0.285714 (exactly 2/7), so C = arccos(0.285714) = 73.3985°
  2. Law of cosines. cos B = (c² + a² − b²) / (2ca) = (9² + 7² − 8²) / (2 × 9 × 7) = 0.52381 (exactly 11/21), so B = arccos(0.52381) = 58.4119°
  3. Angle sum. A = 180° − B − C = 180° − 58.4119° − 73.3985° = 48.1897°
  4. Perimeter. a + b + c = 7 + 8 + 9 = 24
  5. Heron's formula. s = (a + b + c)/2 = 12; area = √(s(s − a)(s − b)(s − c)) = √(12 × 5 × 4 × 3) = 26.8328 (exactly 12√5)
  6. Area from two sides. ½ab sin C = ½ × 7 × 8 × sin 73.3985° = 26.8328, the same area
  7. Heights. h = 2 × area / base: h_a = 7.6665, h_b = 6.7082, h_c = 5.9628
  8. Inradius and circumradius. r = area / s = 2.2361; R = a / (2 sin A) = 4.6957

Using the calculator

Fill in any three of the six boxes and leave the other three empty. At least one has to be a side. The solver works out which case you've given it, solves the triangle and shows each step with the rule it used.

Side a always faces angle A, b faces B and c faces C. So if you know two sides and the angle where they meet, put the angle in the box whose letter isn't one of those sides. With sides a and b, the angle between them is C.

Sides can be whole numbers, decimals, fractions like 3/4 or roots like 5√2 (type sqrt(2) if √ is hard to reach). Angles go in degrees, or switch to radians and type 0.6 or π/3. Whatever you type stays in your browser.

Exact answers appear beside the decimals when the inputs allow it. Whole-number or decimal sides, and angles that are whole multiples of 15°, give results like 12√5 or 10√3 − 10. Anything else gets decimals only.

The five cases

S is a side and A an angle, in the order they sit around the triangle.
CaseYou knowHow it's solvedTriangles
SSSThree sidesLaw of cosines for two angles, angle sum for the thirdOne, if the two shorter sides add up to more than the longest
SASTwo sides and the angle between themLaw of cosines for the third side, then for an angle, then angle sumAlways one
ASATwo angles and the side between themAngle sum for the third angle, law of sines for the two sidesOne, if the angles add up to less than 180°
AASTwo angles and a side that isn't between themThe same as ASAOne, if the angles add up to less than 180°
SSATwo sides and an angle that isn't between themLaw of sines for a second angle, then check its supplementTwo, one or none

Worked example: three sides

Take a = 7, b = 8 and c = 9. The law of cosines turns three sides into an angle: cos A = (b² + c² − a²) / 2bc = (64 + 81 − 49) / 144 = 2/3, so A = arccos(2/3) = 48.1897°.

The same rule gives B = 58.4119°. The angles of a triangle add up to 180°, so C = 180° − 48.1897° − 58.4119° = 73.3985°.

For the area, Heron's formula needs only the sides. The semiperimeter is s = (7 + 8 + 9)/2 = 12, and the area is √(12 × 5 × 4 × 3) = √720 = 12√5, about 26.8328.

The calculator works out the largest angle first. A cosine can tell an obtuse angle from an acute one and a sine can't, and only the largest angle can be obtuse.

Worked example: two angles and a side

With A = 45°, B = 60° and c = 10, the third angle comes first: C = 180° − 45° − 60° = 75°. Every angle is now known, and the law of sines scales the one side you have into the other two.

a = c sin A / sin C = 10 × sin 45° / sin 75° = 7.3205, and b = 10 × sin 60° / sin 75° = 8.9658. Since 75° is a multiple of 15°, its sine is exact, (√6 + √2)/4, and a works out to exactly 10√3 − 10.

The ambiguous case: two triangles or none

Two sides and an angle that isn't between them can describe two different triangles. Try a = 6, b = 8 and A = 35°. The law of sines gives sin B = 8 sin 35° / 6 = 0.7648.

Two angles below 180° have that sine, 49.8864° and 130.1136°. Both leave room for a third angle, so both triangles exist. In one, C = 95.1136° and c = 10.419. In the other, C = 14.8864° and c = 2.6874.

Picture side a as a stick hinged at the top of side b, swinging down to the base line. If it's long enough to reach, it can land in two places. Shorten it to a = 3 and sin B would be 1.5295, which no angle has, so the stick misses the line and no triangle fits. Make it longer than b, as with a = 9, and only one landing point is left on the right side of the hinge.

The calculator shows both triangles when there are two, each with its own drawing and working.

Area, perimeter and heights

The area is worked out two ways, as a check. Heron's formula uses the three sides, area = √(s(s − a)(s − b)(s − c)) with s half the perimeter. The other way is ½ab sin C, two sides and the angle between them.

Each height (altitude) runs from a corner at right angles to the opposite side, and h = 2 × area ÷ that side. In an obtuse triangle two of the heights land outside the triangle, on the opposite side extended, and the drawing shows the base extended as a dotted line when that happens to h_c.

The inradius r is the radius of the largest circle that fits inside, area ÷ s. The circumradius R is the radius of the circle through all three corners, a ÷ (2 sin A), and the law of sines says every side over the sine of its angle gives the same 2R.

Types of triangle

NameWhat it means
EquilateralAll three sides equal, and every angle 60°
IsoscelesAt least two sides equal, and the angles opposite them equal
ScaleneAll three sides different
AcuteEvery angle less than 90°
RightOne angle exactly 90°
ObtuseOne angle more than 90°

Printable triangle worksheet

On the sheet
Same sheet number, same questions.

Solving triangles

Name:

Side a is opposite angle A, b opposite B and c opposite C. Sketches are to scale. Give sides to 1 decimal place and angles to 0.1°.

  1. Right triangle with C = 90°, hypotenuse c = 16 and A = 20°. Use SOH CAH TOA to find a.Triangle with a = 5.47, b = 15.04, c = 16, drawn to scaleA 20°BC 90°a = ?bc = 16
  2. Right triangle with C = 90°, legs a = 9 and b = 15. Find angle A.Triangle with a = 9, b = 15, c = 17.49, drawn to scaleA = ?BC 90°a = 9b = 15c
  3. a = 15, b = 7, c = 11. Find the largest angle.Triangle with a = 15, b = 7, c = 11, drawn to scaleABCa = 15b = 7c = 11
  4. a = 12, b = 9 and C = 140°. Find c.Triangle with a = 12, b = 9, c = 19.76, drawn to scaleABC 140°a = 12b = 9c = ?
  5. c = 10, A = 52° and B = 32°. Find a.Triangle with a = 7.92, b = 5.33, c = 10, drawn to scaleA 52°B 32°Ca = ?bc = 10
  6. a = 9, A = 42° and B = 32°. Find b.Triangle with a = 9, b = 7.13, c = 12.93, drawn to scaleA 42°B 32°Ca = 9b = ?c
  7. a = 8, b = 9 and A = 37°. How many triangles fit? Find B for each.Triangle with a = 8, b = 9, c = 13.08, drawn to scaleA 37°B = ?Ca = 8b = 9c
  8. a = 13, b = 7 and C = 49°. Find the area.Triangle with a = 13, b = 7, c = 9.93, drawn to scaleABC 49°a = 13b = 7c
Made at stringmash.com/triangle-calculator · sheet 1

Solving triangles: answer key

  1. a = 16 sin 20° = 5.5
  2. tan A = 9/15, A = 31°
  3. A = 110.9°
  4. c = 19.8
  5. C = 96°, a = 7.9
  6. b = 7.1
  7. two: B = 42.6° or B = 137.4°
  8. ½ × 13 × 7 × sin 49° = 34.3
Made at stringmash.com/triangle-calculator · sheet 1

The worksheet

Eight questions on one page, each with a sketch to scale. Two right-triangle questions for SOH CAH TOA come first, then one each for SSS, SAS, ASA and AAS, an ambiguous case with two answers, and an area from two sides and an angle.

Every sheet number prints its own questions, and the second page is the answer key, worked by the same solver as the calculator. Print on A4 or US Letter.

Questions

How many values do I need to solve a triangle?

Three, and at least one has to be a side. Three angles fix the shape but not the size, since any enlargement has the same angles.

When do I use the law of sines and when the law of cosines?

Use the law of cosines when you know three sides, or two sides and the angle between them. Use the law of sines once you know a side and the angle facing it, as in ASA, AAS and SSA.

Why does SSA sometimes give two triangles?

The law of sines gives the sine of the missing angle, and two angles between 0° and 180° share each sine, such as 30° and 150°. If both leave room for a third angle, both triangles exist.

Why does it say no triangle fits?

Either the two shorter sides don't add up to more than the longest, the angles add up to 180° or more, or in SSA the side opposite the angle is too short to reach the base.

How do I find the area of a triangle from three sides?

Use Heron's formula. Halve the perimeter to get s, then take √(s(s − a)(s − b)(s − c)). Sides 4, 13 and 15 give s = 16 and an area of √(16 × 12 × 3 × 1) = 24.

Can I type angles in radians?

Yes. Switch Angles in to radians. Decimals work, and so do fractions of π such as π/3 or 2pi/3, which keep the answers exact.

Is the drawing to scale?

Yes. Side c lies along the bottom with A on the left, and the shape is scaled to fit. The dashed line is the height from C.

Sources

Added and reviewed . What's new