In geometry, a hypotenuse (rarely: hypothenuse[1]) is the longest side of a right-angled triangle, the side opposite of the right angle. The length of the hypotenuse of a right triangle can be found using the Pythagorean theorem, which states that the square of the length of the hypotenuse equals the sum of the squares of the lengths of the other two sides. For example, if one of the other sides has a length of 3 (when squared, 9) and the other has a length of 4 (when squared, 16), then their squares add up to 25. The length of the hypotenuse is the square root of 25, that is, 5.

A right-angled triangle and its hypotenuse, h, along with catheti (legs) c1 and c2.

The length of the hypotenuse is calculated using the square root function implied by the Pythagorean theorem. Using the common notation that the length of the two legs of the triangle (the sides perpendicular to each other) are a and b and that of the hypotenuse is c, we have

c=a2+b2.{\displaystyle c={\sqrt {a^{2}+b^{2}}}.}

The Pythagorean theorem, and hence this length, can also be derived from the law of cosines by observing that the angle opposite the hypotenuse is 90° and noting that its cosine is 0:

Many computer languages support the ISO C standard function hypot(x,y), which returns the value above. The function is designed not to fail where the straightforward calculation might overflow or underflow and can be slightly more accurate.

Some scientific calculators provide a function to convert from rectangular coordinates to polar coordinates. This gives both the length of the hypotenuse and the angle the hypotenuse makes with the base line (c1 above) at the same time when given x and y. The angle returned will normally be that given by atan2(y,x).