{"id":24341,"date":"2021-10-14T09:46:23","date_gmt":"2021-10-14T04:16:23","guid":{"rendered":"https:\/\/python-programs.com\/?p=24341"},"modified":"2021-11-05T21:07:10","modified_gmt":"2021-11-05T15:37:10","slug":"python-program-for-hypot-function","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-for-hypot-function\/","title":{"rendered":"Python Program for hypot() Function"},"content":{"rendered":"

In the previous article, we have discussed Python Program for atanh() Function<\/a>
\nhypot() Function in Python:<\/strong><\/p>\n

The square root of the sum of squares of the specified arguments is returned by the Python hypot() function.<\/p>\n

The Euclidean norm is returned by the math.hypot() method. The Euclidian norm is the distance between the origin and the given coordinates.<\/p>\n

This method was only used prior to Python 3.8 to find the hypotenuse of a right-angled triangle: sqrt(x*x + y*y).<\/p>\n

Since Python 3.8, this method is also used to compute the Euclidean norm. The coordinates passed are assumed to be like in n-dimensional cases (x1, x2, x3, …, xn). So sqrt(x1*x1 + x2*x2 + x3*x3…. xn*xn) is used to calculate Euclidean length from the origin.<\/p>\n

Syntax:<\/strong><\/p>\n

math.hypot(x1, x2, x3,. . . .xn )<\/pre>\n

Parameters:<\/strong><\/p>\n

x1, x2, x3,. . . . ,xn:<\/strong> These are required. These are numbers. Two or more coordinates are represented by two or more points.<\/p>\n

Return Value:<\/strong><\/p>\n

For n inputs, the return value is a float representing the Euclidean distance from the origin, or the hypotenuse of a right-angled triangle for two inputs.<\/p>\n