Pythagorean Theorem

Relates the two legs a and b of a right triangle to the hypotenuse c.

a² + b² = c²

The hypotenuse is c = √(a² + b²). Some triangles, like 3-4-5, have whole-number sides.

The distance formula on the coordinate plane comes from this theorem.

Calculator

Change a value and the result and picture update instantly.

Result

Hypotenuse c5

Animated picture

The picture follows your values. Some points and shapes can be dragged.

Use in game development

Every distance check — player to enemy, attack range, movement speed — uses it.

Code example (JavaScript)

const dist = Math.hypot(dx, dy); // √(dx² + dy²)

What the symbols mean

SymbolMeaning
aLeg a
bLeg b
cHypotenuse c

More formulas in this category

Frequently asked questions

What is the formula for Pythagorean Theorem?
The formula for Pythagorean Theorem is a² + b² = c². Relates the two legs a and b of a right triangle to the hypotenuse c.

Math Formula Quiz Geometry (Area & Volume)

Sources

Checked: 2026-11-29