Right Triangle Calculator
Result
Hypotenuse
- Leg a
- 3.00 cm
- Leg b
- 4.00 cm
- Angle A
- 36.87 °
- Angle B
- 53.13 °
- Area
- 6.00 cm²
- Perimeter
- 12.00 cm
A right triangle calculator takes two of a right triangle's five measurements and returns all of them. The five are the three sides and the two acute angles, and any two of them are enough to pin the triangle down completely — with one exception, which is covered further down and is worth knowing before you use the page. Put in two legs and the hypotenuse follows from the pythagorean theorem; put in one leg and the hypotenuse and the other leg follows from the same theorem rearranged; put in a side and an acute angle and the remaining sides come out of the sine, cosine and tangent of that angle. The angle the page reports is the one opposite the side you typed: angle A faces leg a, angle B faces leg b, and the two of them always add to ninety degrees, because the right angle has already taken the third quarter turn. Everything the page prints is derived from two numbers, so the outputs are consistent with each other by construction rather than by luck — the three sides satisfy the pythagorean theorem exactly, the two acute angles sum to ninety exactly, and the area and perimeter are computed from the same unrounded sides that the rest of the panel shows. Two of the seven rows are usually echoes of what you typed, and that is deliberate: the promise of the page is the whole triangle, and a panel that changed shape depending on which boxes you filled would be harder to read than one that always shows the same seven lines. The unit of the output is always centimetres and square centimetres, whatever unit you entered, because the page converts your input to a common unit before it solves anything. The table below works through seven triangles, and the first column of each row says which two measurements that row started from — without it you could not tell which of the printed numbers was the answer and which was given.
Seven right triangles solved from two measurements each
| Given | Leg a (cm) | Leg b (cm) | Hypotenuse (cm) | Angle A (°) | Angle B (°) | Area (cm²) | Perimeter (cm) |
|---|---|---|---|---|---|---|---|
| a, b | 3 | 4 | 5 | 36.87 | 53.13 | 6 | 12 |
| a, b | 5 | 12 | 13 | 22.62 | 67.38 | 30 | 30 |
| a, c | 6 | 8 | 10 | 36.87 | 53.13 | 24 | 24 |
| b, c | 5 | 12 | 13 | 22.62 | 67.38 | 30 | 30 |
| a, b | 8 | 15 | 17 | 28.07 | 61.93 | 60 | 40 |
| a, A | 3 | 5.2 | 6 | 30 | 60 | 7.79 | 14.2 |
| c, A | 5 | 8.66 | 10 | 30 | 60 | 21.65 | 23.66 |
Eight columns, and the first one is the one to read first: it names the two measurements the row started from — a, b for two legs, a, c or b, c for a leg and the hypotenuse, a, A or c, A for a side and an angle. Without it you could not tell which of the seven printed numbers was given and which was worked out, because a solved triangle prints all of its measurements either way. Two pairs of rows are deliberate self-checks. The second row and the fourth are the same 5-12-13 triangle reached two different ways, one from its legs and one from the hypotenuse and a leg, and all six numbers agree. The last two rows are the same 30-60-90 shape at two sizes, reached once from a leg and an angle and once from the hypotenuse and an angle, and the sides are in the ratio one to root three to two in both. Note also that the angles across the whole table come in complementary pairs that add to exactly ninety, and that only the first, second and fifth rows are the familiar whole-number triangles.
Formula
a² + b² = c² A + B = 90° sin A = a ÷ c tan A = a ÷ b area = a × b ÷ 2 perimeter = a + b + c
- a, b
- The two legs, the sides that meet at the right angle. The page reduces every input to these two before it calculates anything else, so a case that started from a hypotenuse and an angle is turned into two legs first
- c
- The hypotenuse, the side opposite the right angle and always the longest. It is the page's main result, and it is always recalculated rather than echoed — even when you were the one who typed it
- A, B
- The two acute angles. A is the one opposite leg a and B the one opposite leg b; each of them is between zero and ninety degrees, and together they make up what is left of the triangle's hundred and eighty
Use this page when you know two measurements of a right triangle and want the rest of it: two legs, a leg and the hypotenuse, or any one side together with either acute angle. It is the general-purpose right triangle solver, and it differs from the pythagorean theorem page in what it leads with — that page answers the narrower question of the missing side, while this one answers the whole triangle and puts the hypotenuse at the top no matter which two boxes you filled. It also differs from the triangle page, which is the same idea without the right angle: that one needs two sides plus the angle between them, and this one gets a great deal more out of the same two numbers because the right angle is a third piece of information for free. A right triangle with both legs equal is the isosceles case, and that page prints the same figure described in its own terms.
Worked examples
Two legs, 3 and 4
- The two legs are given, so the pythagorean theorem gives the hypotenuse: 9 plus 16 is 25, and the square root of 25 is 5
- Angle A faces the side of length 3, so its tangent is 3 over 4, which is 36.87 degrees
- Angle B is what is left of ninety degrees, so it is 53.13
- The area is half of three times four, and the perimeter is the three sides added
The triangle the page loads with, and the smallest of the whole-number right triangles — the same one the pythagorean theorem page is built around, so the two agree to the last decimal on the hypotenuse, the area and the perimeter. Notice that both legs appear in the output as well as being typed in: the panel always prints all seven quantities, and the promise that it solves the whole triangle is the reason. Both angles are between zero and ninety, and they add to exactly ninety rather than 89.99, because the second one is computed as the remainder.
A leg and the hypotenuse, 6 and 10
- The hypotenuse and one leg are given, so the other leg is the square root of ten squared minus six squared
- A hundred minus thirty-six is sixty-four, whose square root is 8
- The angles follow from the legs: the tangent of A is 6 over 8
- Three sides are now known, so the area and the perimeter are arithmetic
The other leg comes out of the same theorem read backwards: a hundred minus thirty-six is sixty-four, and the square root of sixty-four is eight. This is the case where the pythagorean theorem does subtraction rather than addition, and it is also the one that fails when the two boxes are filled in the wrong order — a hypotenuse shorter than a leg has no solution, and the page says so rather than returning a number. The angles match the three-four-five row exactly, because six-eight-ten is that triangle doubled.
A leg and the angle opposite it, 3 and 30 degrees
- Angle A faces leg a, so the sine of thirty degrees relates the leg to the hypotenuse: the leg is the hypotenuse times a half
- So the hypotenuse is twice the leg, which is 6
- The other leg is the leg over the tangent of thirty degrees, about 5.2
- Angle B is what is left of ninety, so it is 60
This is the 30-60-90 triangle, the one whose sides are in the ratio one to root three to two, and it is the row that shows which angle is which: A is opposite the side you gave, so the side of length 3 is the one facing the thirty degree angle and the short one. Fill in the same leg with angle B equal to sixty and every number comes out identical — the two angles describe the same shape, and that pair is the page's own check on the mapping. The leg, the area and the perimeter are rounded to two decimal places, so 5.196 appears as 5.2.
The hypotenuse and an angle, 10 and 30 degrees
- With the hypotenuse known, the leg facing thirty degrees is the hypotenuse times the sine of thirty, which is 10 times a half
- The other leg is the hypotenuse times the cosine of thirty, about 8.66
- The angles are already known: thirty and its complement sixty
- The area is half of five times 8.66, and the perimeter is the three sides added
The same shape as the row above at twice the size — the sides are 5, 8.66 and 10 against 3, 5.2 and 6, and the ratio between them is the same everywhere, which is what it means for two triangles to have the same angles. Note that the hypotenuse is printed even though you typed it: it is recomputed from the legs rather than echoed, so the three sides on the panel always satisfy the pythagorean theorem exactly and can never contradict each other. The rounding to two decimal places is what makes 8.66 rather than 8.6602.
Limitations
Four things worth knowing. First, exactly two of the five boxes must be filled, and the two must not both be angles. One box is not enough information, three is more than enough, and the page distinguishes those two cases in its message; two angles fill the count and still cannot be solved, because two angles fix the shape and say nothing about the size. The panel itself does not mark which boxes it is waiting for, so the count is on you. Second, both acute angles are accepted but neither may be zero or ninety, because a right triangle's two acute angles are strictly between those values; a side of zero is refused for the same reason, since a degenerate triangle has no area and no perimeter worth printing. Third, the page reports in centimetres and square centimetres regardless of the unit you typed in — a leg entered in feet is converted before the triangle is solved, and the answers come back in centimetres. Fourth, two of the seven output rows are usually echoes of your own input, so filling in a leg and seeing that same leg printed back is not the page failing to calculate; the value it prints has been through the unit conversion and the rounding, and the other rows are the ones that carry the new information.
Frequently asked questions
- How many of the five boxes do I fill in?
- Exactly two. Any two of the three sides and the two acute angles are enough to determine a right triangle completely, and one is not enough — a single side leaves the shape free and a single angle leaves the size free. The page also refuses three, not because three measurements are ambiguous but because the message you need then is about the count rather than about the arithmetic. The one pair that fills both boxes and still fails is the two angles, which fix the shape and not the size.
- Why does the panel print the side I typed in?
- Because the page promises the whole triangle rather than the parts you did not supply. Its output list is fixed, so a leg you typed appears among the seven rows along with everything else. The line looks like it did nothing, but the value has been through the unit conversion and the rounding, and the other six rows are where the new information is. The alternative — a panel whose rows changed according to which boxes you filled — would be harder to read, not easier.
- Which angle is angle A?
- Angle A is the one opposite leg a; angle B is opposite leg b. So if you type a leg of 3 and an angle of 30 degrees, the page reads the 3 as the side facing that thirty degree angle, which makes it the short leg of a 30-60-90 triangle. The two acute angles always add to exactly ninety degrees, because the right angle takes the remaining ninety of the triangle's hundred and eighty, and the page computes the second one as the remainder rather than deriving it separately — which is why they never round to 89.99.
- What units are the answers in?
- Centimetres and square centimetres always, whatever unit you entered. The page converts your input into a common unit before it solves the triangle, and the outputs are declared in centimetres, so a leg typed in feet comes back as a number of centimetres. Angles are always in degrees for the same reason: you may enter them in radians or gradians, but the panel reports degrees.
- What is the difference between this page and the pythagorean theorem page?
- This page accepts more inputs and returns more outputs. The pythagorean page takes two of the three sides and answers the narrower question of the missing side; this one takes any two of five measurements — including angles — and returns the complete figure, leading with the hypotenuse in every case. The two agree exactly wherever they overlap, because both are working on the same triangle with the same rounding.
- Why is a hypotenuse shorter than a leg refused?
- Because no such triangle exists. The hypotenuse is the side opposite the right angle and it is always the longest of the three, so it must be strictly greater than either leg. When the two boxes are filled with a leg and a hypotenuse and the hypotenuse is the smaller number, the two have almost certainly been entered the wrong way round, and the page says so and suggests swapping them rather than taking the square root of a negative number — which would give no answer at all.
References
- Right Triangle — the five measurements, which combinations determine the triangle, and the identities that relate them — Wolfram MathWorld (United States)
- Pythagorean Theorem — the relation between the three sides, with the converse and the degenerate cases — Wolfram MathWorld (United States)
- Finding a Side in a Right-Angled Triangle — using the sine, cosine and tangent to solve for a side from one side and one angle — Math is Fun (United Kingdom)
- Pythagoras' Theorem — the theorem from first principles, with the converse and worked examples — Math is Fun (United Kingdom)