Python – Find Euclidean Norm – hypot() Function with Examples

hypot() function is used to find the the Euclidean norm, sqrt(x*x + y*y) in Python for the given input(x – parameter).

 

Syntax of hypot() Function

The syntax of hypot() function in Python is:

math.hypot(x, y)

 

Parameters of hypot() Function in Python

x – Where x is any valid python number (positive or negative). This parameter is required.
Note: If the x parameter is not a number, hypot() function will return an Error.

 

Compatibility

hypot() function is available and compatible with both Python 2.x and 3.x. This function is a part of python standard math library.

 

Return Value of hypot() Function in Python

hypot() function returns the Euclidean norm, sqrt(x*x + y*y) for the given input.

 

Python hypot() Function Example

# import math library
import math
print(math.hypot(-0.2))
print(math.hypot(0))
print(math.hypot(0.2))
print(math.hypot(77))
print(math.hypot(-3677))

Output: