Calculating the length of the hypotenuse of a triangle is possible using the square root function on the sum of two squares, but hypot(x, y) avoids problems that occur when squaring very large or very small numbers.
The magnitude of the hypotenuse from (0, 0) to (x, y) can be calculated using: .