CALCULATORCASTLE

Triangle Calculator

Solve triangles — find sides, angles, area, and perimeter.

About

Triangle Calculator

A triangle is a polygon with three vertices. A vertex is a point where two or more curves, lines or edges meet; in a triangle the three vertices are joined by three line segments called edges. A triangle is usually referred to by its vertices, so a triangle with vertices a, b and c is written Δabc.

Triangles are described both by the length of their sides and by their internal angles. A triangle whose three sides are the same length is equilateral, one with two equal sides is isosceles, and one with no two sides equal is scalene.

60°60°60°
Equilateral
Isosceles
Scalene

Tick marks on an edge are the usual notation for side length: the same number of ticks means the same length. Concentric arcs at a vertex do the same job for angles. Side lengths and internal angles are directly related, which is why an equilateral triangle also has three equal angles of 60° each.

The small diagram beside the input boxes is a schematic and is not drawn to scale. It just shows which box belongs to which side or angle. The drawing in the results is different: it is built from the solved triangle, so it changes shape as you type and an obtuse triangle really does lean out past its base.

Right, obtuse and acute

Classified by their internal angles, triangles fall into two groups: right or oblique. A right triangle has one angle of exactly 90°, marked with a small square at that vertex. Its longest edge, the one opposite the right angle, is the hypotenuse.

Any triangle that is not a right triangle is oblique, and an oblique triangle is either obtuse or acute. An obtuse triangle has one angle greater than 90°. An acute triangle has all three angles below it. The calculator names the triangle both ways at once, so 3, 4, 5 comes back as a right scalene triangle and 1, 1, 1 as equilateral.

90°
Right
>90°
Obtuse
<90°<90°<90°
Acute

Triangle facts, theorems and laws

  • No triangle can have more than one angle of 90° or greater. Two right angles already use up the full 180°, leaving nothing for the third.
  • The interior angles always add to 180°. An exterior angle equals the sum of the two interior angles not adjacent to it, which is the same as subtracting the angle at that vertex from 180°.
  • Any two sides added together are longer than the third. This is the triangle inequality, and it is what the calculator checks before accepting three side lengths. Enter 1, 2, 9 and nothing closes.
  • Sides and angles are ranked together: the longest side sits opposite the largest angle, and the shortest opposite the smallest.

Pythagorean theorem

The Pythagorean theorem applies to right triangles only. For any right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides. It follows that any triangle whose sides satisfy the condition is a right triangle. Where a and b are the two shorter sides and c is the hypotenuse:

a2+b2=c2

Given a = 3 and c = 5, find b: 9 + b² = 25, so b² = 16 and b = 4.

Some right triangles come up often enough to be worth memorising. The 30-60-90 triangle has sides in the ratio 1 : √3 : 2, so a short side of 1 gives 1.73205 and 2. The 45-45-90 triangle has two equal legs and a hypotenuse √2 times as long, 1.41421 for legs of 1. The 3-4-5 triangle and its multiples, 6-8-10 and 9-12-15, are right triangles with whole-number sides.

Law of sines

The ratio of a side to the sine of its opposite angle is the same for all three pairs. That relationship is what lets the calculator find unknown sides and angles once enough is known.

asin(A)=bsin(B)=csin(C)

Given b = 2, B = 90° and C = 45°, find c:

2sin(90°)=csin(45°)

which gives c = 2 × (√2 / 2) = √2, or 1.41421.

There are cases where the law of sines allows two different triangles from the same data. Given two sides and an angle that is not between them, the sine has two solutions in range, one acute and one obtuse. The calculator solves the acute one and tells you when the second exists.

Law of cosines

Given all three sides, each angle can be recovered directly. Referring to the triangle in the calculator, with a, b and c known:

A=arccos(b2+c2a22bc) B=arccos(a2+c2b22ac) C=arccos(a2+b2c22ab)

Given a = 8, b = 6 and c = 10, find B:

B=arccos(82+102622×8×10)=arccos(0.8)=36.87°

The same law rearranges to find a missing side when two sides and the angle between them are known, which is how the calculator handles that combination.

Area of a triangle

Several equations give the area, and which one to use depends on what is known. The most familiar involves the base b and the height h. The base is any side; the height is the perpendicular distance from the opposite vertex down to that side, or to the line extending it.

area=12b×h

A triangle with a base of 6 and a height of 5 has an area of ½ × 6 × 5 = 15. Any of the three sides can play the part of the base and the answer is the same, which is why the calculator reports all three heights.

56
Height 5 drawn perpendicular to a base of 6, giving an area of 15

Given two sides and the angle between them, no height is needed:

area=12ab×sin(C)

The same relationship written the other two ways is 12bc×sin(A) and 12ac×sin(B). Given a = 9, b = 7 and C = 30°, the area is ½ × 9 × 7 × 0.5 = 15.75.

Heron's formula needs no angle and no choice of base. It uses only the three side lengths and the semiperimeter s:

area=s(sa)(sb)(sc) s=a+b+c2

For a = 3, b = 4 and c = 5 the semiperimeter is 6, so the area is √(6 × 3 × 2 × 1) = √36 = 6, which agrees with the half-base-times-height answer for the same triangle.

Median, inradius and circumradius

Median

A median is the line segment from a vertex to the midpoint of the opposite side. Every triangle has three, and all three cross at a single point called the centroid, which is the mean position of all the points in the triangle. It is also the balance point: a triangle cut from card balances on a pin at its centroid.

mambmcABC
The three medians cross at the centroid

The lengths are given by:

ma=2b2+2c2a24 mb=2a2+2c2b24 mc=2a2+2b2c24

For a = 2, b = 3 and c = 4:

ma=2×32+2×42224=3.391

The centroid always sits two thirds of the way along each median, measured from the vertex.

Inradius

The inradius is the radius of the largest circle that fits inside the triangle. That circle touches all three sides, and its centre, the incenter, is where the three angle bisectors meet. The incenter is the same perpendicular distance from every side, which is what makes the circle fit.

inradius
The incircle touches all three sides; its radius is the inradius

Calculated from the area and the semiperimeter:

inradius=areas

For the 3, 4, 5 triangle the area is 6 and the semiperimeter is 6, so the inradius is exactly 1.

Circumradius

The circumradius is the radius of the circle that passes through all three vertices. Its centre, the circumcenter, is where the perpendicular bisectors of the sides meet, and it does not have to lie inside the triangle: in an obtuse triangle it falls outside, and in a right triangle it sits exactly on the midpoint of the hypotenuse. Every triangle has a circumcircle, so every triangle has a circumradius.

circumradius
The circumcircle passes through all three vertices
circumradius=a2sin(A)

Side a and angle A are used here, but any side with its opposite angle gives the same value, which is the law of sines again. For the 3, 4, 5 triangle the circumradius is 2.5, half the hypotenuse, exactly as the right-triangle rule predicts.

Which three values are enough

Three pieces of information fix a triangle, as long as at least one is a side. Three angles fix the shape but not the size, so they describe an entire family of similar triangles rather than one triangle.

GivenCaseResult
Three sidesSSSOne triangle, if the triangle inequality holds
Two sides and the angle between themSASOne triangle
Two angles and the side between themASAOne triangle
Two angles and a side not between themAASOne triangle
Two sides and an angle not between themSSANone, one or two triangles
Three anglesAAAShape only, no size

SSA is the awkward one, known as the ambiguous case. With sides of 5 and 8 and an angle of 30° opposite the 5, the sine works out at 0.8, which is satisfied by 53.13° and by 126.87°. Both give a valid triangle. Lengthen the side opposite the given angle past the other side and the second solution disappears; shorten it too far and no triangle exists at all.

Reading the rest of the output

The vertex coordinates place the triangle on a grid with A at the origin and B on the positive x-axis, so side c lies along the base. C then falls wherever angle A and side b put it. This is a convenient frame rather than the only one, and it makes the three centre points easy to compare.

The centroid, incenter and circumcenter are three different centres and they usually sit in three different places. They coincide only in an equilateral triangle. The heights, sometimes called altitudes, are the perpendicular distances used in the half-base-times-height area formula, one for each choice of base.

Angles come back in degrees, in degrees, minutes and seconds when the degree value is not whole, and in radians. Where the radian value is a neat fraction of π it is shown that way too, so 75° appears as 5/12π alongside 1.309. Radian input works in the same notation: type pi/4 or 2pi/3 straight into an angle box after switching the unit.

Common questions

Frequently asked questions

Any three of the six, as long as at least one is a side. Three sides, two sides and an angle, or two angles and a side all work. Three angles are not enough: they fix the shape but not the size, so they describe a whole family of similar triangles.

Subtract the other two from 180 degrees. Interior angles always add to 180, so a triangle with angles of 45 and 60 has a third angle of 75. That is the first step the calculator takes whenever two angles are given.

The law of sines pairs each side with its opposite angle and is the tool when you have an angle and its opposite side. The law of cosines relates all three sides to one angle, so it handles three known sides or two sides with the angle between them.

This is the ambiguous case, and it happens with two sides and an angle that is not between them. The sine of the unknown angle has both an acute and an obtuse solution. With sides of 5 and 8 and 30 degrees opposite the 5, both 53.13 and 126.87 degrees give a real triangle.

Two ways. With two sides and the angle between them, area is half the product of those sides times the sine of the angle. With all three sides, Heron's formula uses the semiperimeter: for 3, 4, 5 the semiperimeter is 6 and the area comes out at 6.

Any two sides added together have to be longer than the third. Sides of 1, 2 and 9 fail it, because 1 plus 2 is nowhere near 9, and no triangle closes. The calculator checks this before it accepts three lengths.

The centroid is where the three medians cross and is the balance point. The incenter is where the angle bisectors cross and is the centre of the largest circle that fits inside. The circumcenter is where the perpendicular bisectors cross and is the centre of the circle through all three vertices. They only coincide in an equilateral triangle.

Yes. In an obtuse triangle it falls outside, and in a right triangle it sits exactly on the midpoint of the hypotenuse, which is why the circumradius of a 3, 4, 5 triangle is 2.5.

Switch the angle unit to radians and type the value as written, so pi/4, pi/2 and 2pi/3 all work, as do plain decimals like 0.7854. Results still show degrees, radians and the fraction of pi side by side.

The largest angle. Exactly 90 degrees makes it right, more than 90 makes it obtuse, and all three below 90 makes it acute. That is separate from the side classification, so a triangle can be right and scalene at the same time, as 3, 4, 5 is.