What this calculator does
This tool solves a right triangle when you know its two legs: the base a (the horizontal leg) and the height b (the vertical leg). It returns the inclination angle θ at the base — both as decimal degrees and as degrees-minutes-seconds (DMS) — and the length of the hypotenuse c, the slanted side opposite the right angle. The math is pure trigonometry, so it works identically everywhere and with any consistent linear unit (mm, cm, m, inches, feet); just make sure the base and height share the same unit.
How to use it
Enter the base a and the height b. Both should be measured perpendicular to each other (the right angle is between them). Press calculate to get the angle and hypotenuse. Typical uses include roof pitch, wheelchair-ramp slopes, the rise/run of stairs, L-shaped steel sizing, 3D-modeling vectors, and aiming angles in robotics.
The formula explained
Because the right angle sits between the two legs, the tangent of the base angle equals the opposite leg over the adjacent leg: \(\tan\theta = b / a\), so $$\theta = \arctan\!\left(\frac{b}{a}\right)$$ We actually use \(\operatorname{atan2}(b, a)\) internally so a base of zero gives exactly 90° instead of dividing by zero. The hypotenuse comes from the Pythagorean theorem: $$c = \sqrt{a^{2} + b^{2}}$$ To express the angle in DMS, the whole degrees D are floored off, the fractional part times 60 gives minutes M, and the leftover times 60 gives seconds S.
Worked example
With a = 2 and b = 1: $$\theta = \arctan\!\left(\tfrac{1}{2}\right) = 26.565051177^\circ$$ In DMS that is \(26^\circ\,33'\,54.18''\). The hypotenuse is $$c = \sqrt{4 + 1} = \sqrt{5} \approx 2.2360679775$$ A famous check is the 3-4-5 triangle: \(a = 3\), \(b = 4\) gives \(\theta = 53.13010235^\circ\) and \(c = 5\) exactly.
FAQ
What unit is the hypotenuse in? The same unit you used for the base and height. The tool is unit-agnostic.
What if the base is 0? The triangle is vertical, the angle is 90°, and the hypotenuse equals the height.
Why use atan2 instead of atan? \(\operatorname{atan2}(b, a)\) avoids a divide-by-zero when \(a = 0\) and correctly returns 90°, while still matching \(\arctan(b/a)\) for all positive bases.