How the right triangle calculator works
Here is the promise of the 3-4-5 triangle, and of every right triangle: give us any two facts and we hand you the whole thing. Two legs? We find the hypotenuse, both angles, the area, the perimeter, and the altitude. One side and one angle? Same deal. The right angle is doing you an enormous favor: it locks one of the three angles at 90 degrees, so two independent pieces of information pin down everything else. The only combination that fails is two angles with no side, because angles alone fix the shape but not the size.
The calculator uses exactly the tools you would use by hand (the Pythagorean theorem when you know two sides, trig ratios when you know an angle) and shows every substitution step so you can follow, or check homework, line by line. For triangles without a right angle, head to the general triangle calculator.
The Pythagorean theorem
a and b are the two legs (the sides that meet at the right angle) and c is the hypotenuse, the longest side, sitting opposite the right angle. Rearranged, c = √(a² + b²) when you know both legs, and a missing leg is a = √(c² - b²). That subtraction is the version people forget: the hypotenuse is always the biggest side, so when it is known, you subtract squares instead of adding them. If your "leg" comes out imaginary, you accidentally entered a leg longer than the hypotenuse.
The theorem is also the engine behind the distance formula: the distance between two points is just the hypotenuse of the right triangle their coordinates draw, which is the same idea a slope calculation exploits with its rise and run.
SOH-CAH-TOA, explained like a person
Forget reciting the acronym for a second. Stand at one of the acute angles and look across the triangle. The side straight across from you is the opposite side. The side you are touching (that is not the hypotenuse) is the adjacent side. The hypotenuse is the hypotenuse no matter where you stand.
The three trig ratios are just three ways of comparing those sides. Sine is opposite over hypotenuse: it answers "how tall is this triangle compared to its longest side?" Cosine is adjacent over hypotenuse. Tangent is opposite over adjacent, the ratio of the two legs, which is why tangent is also the slope of a ramp at that angle. In practice you pick the ratio that uses the side you know and the side you want. Know the adjacent leg, want the opposite one? That pair belongs to tangent, so opposite = adjacent × tan(angle). Know the hypotenuse, want the opposite leg? Sine: opposite = hypotenuse × sin(angle). The calculator picks the right ratio for you and shows which one it used.
The two special right triangles
Two right triangles are so tidy they get their own names, and memorizing them saves real time.
The 45-45-90 triangle is half a square, cut along the diagonal. Its sides run in the ratio 1 : 1 : √2, so the hypotenuse is about 1.414 times either leg. A square room 10 feet on a side has a 14.14 foot diagonal, no calculator required. (Fun fact: that diagonal is also the diameter of the circle through all four corners, which the circle calculator can take from there.)
The 30-60-90 triangle is half an equilateral triangle. Its sides run 1 : √3 : 2. The short leg (opposite the 30 degree angle) is exactly half the hypotenuse, and the long leg is about 1.732 times the short one. If a problem hands you either of these angle sets, you can write down all three sides from a single one, which is exactly what this calculator does when you enter, say, one leg and 30 degrees.
Worked example
Take the classic legs a = 3 and b = 4:
c = √(3² + 4²) = √(9 + 16) = √25 = 5
Angle A = arcsin(3 ÷ 5) = 36.87°, and angle B = 90 - 36.87 = 53.13°.
Area = (3 × 4) ÷ 2 = 6, perimeter = 3 + 4 + 5 = 12, and the altitude to the hypotenuse is (3 × 4) ÷ 5 = 2.4.
The mistake that flips your answer
Mislabeling opposite and adjacent. The labels are relative to the angle you are standing at, so the side that is "opposite" from angle A is "adjacent" to angle B. Swap them and you silently compute the wrong leg: tan(30°) × 8 gives 4.62 while 8 ÷ tan(30°) gives 13.86, and both look plausible on paper. The sanity check takes five seconds: the biggest side must face the biggest angle. The hypotenuse faces the 90, the longer leg faces the larger acute angle, and the shorter leg faces the smaller one. If your solved triangle breaks that ordering, a label got swapped. This is also why the calculator names its angles: A is always opposite leg a, B always opposite leg b.