Angle and Hypotenuse from Base and Height

Angle and Hypotenuse from Base and Height

Growing AI Skill PRO

Enter Calculation

Enter the base (horizontal leg) and height (vertical leg) in any consistent unit. The hypotenuse is returned in that same unit.

Formula

θ=arctan⁡(Height bBase a)c=Base a2+Height b2\begin{gathered} \theta = \arctan\!\left(\frac{{{\text{Height }b}}}{{{\text{Base }a}}}\right) \qquad c = \sqrt{{{\text{Base }a}}^{2} + {{\text{Height }b}}^{2}} \end{gathered}
Usage stats

Advertisement

Results

Angle θ
26.5650511771
degrees
Angle θ (DMS) 26° 33′ 54.18″
Hypotenuse c 2.2360679775

Report an error on this page

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.

Advertisement
Right triangle with base a, height b, hypotenuse c, and angle theta at the base
The angle theta comes from arctan(b/a) and the hypotenuse c from the Pythagorean theorem.

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.

Advertisement
Right triangle with base 3, height 4, hypotenuse 5 and labeled angle
Worked example: base 3 and height 4 give a hypotenuse of 5 and an angle of about 53.13 degrees.

Common Right Triangle Ratios and Angles

The angle \(\theta\) is measured at the base corner, between the base (adjacent leg \(a\)) and the hypotenuse \(c\). It follows \(\tan\theta = b/a\). The hypotenuse column is for a base of \(a = 1\), so multiply it by your actual base to scale. Slope percent is rise ÷ run × 100.

Base : Height tan θ Angle θ Hypotenuse (a = 1) Slope %
1 : 1 1.0000 45° 1.4142 (√2) 100%
3 : 4 (3-4-5 triangle, c = 5) 1.3333 53.13° 1.6667 133.33%
4 : 3 (4-3-5 triangle, c = 5) 0.7500 36.87° 1.2500 75%
5 : 12 (5-12-13 triangle, c = 13) 2.4000 67.38° 2.6000 240%
12 : 5 (c = 13) 0.4167 22.62° 1.0833 41.67%
8 : 15 (8-15-17 triangle, c = 17) 1.8750 61.93° 2.1250 187.5%
1 : 2 2.0000 63.43° 2.2361 (√5) 200%
2 : 1 0.5000 26.57° 1.1180 50%
1 : √3 1.7321 60° 2.0000 173.21%
√3 : 1 0.5774 30° 1.1547 57.74%
12 : 1 (1:12 slope) 0.0833 4.76° 1.0035 8.33%
20 : 1 (1:20 slope) 0.0500 2.86° 1.0012 5%
12 : 4 (4/12 roof pitch) 0.3333 18.43° 1.0541 33.33%
12 : 6 (6/12 roof pitch) 0.5000 26.57° 1.1180 50%
12 : 12 (12/12 roof pitch) 1.0000 45° 1.4142 100%

Angles are rounded to two decimals. Swapping base and height gives the complementary angle, so \(\theta_1 + \theta_2 = 90^\circ\) (for example 36.87° + 53.13°).

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.

Last updated:

Most popular in Math and Statistics

View all Math and Statistics calculators