The math.hypot()
function is used to calculate the Euclidean length of a vector in n-dimensional space. It takes two or more numbers as its arguments and returns the square root of the sum of the squares of each argument. For example: math.hypot(3,4)
This would return 5.0, which is the length of the vector (3,4).
math.hypt(*args)
Where, Parameter args
represents arbitrary real numbers.
The math.hypot() function is useful for a variety of calculations involving vectors, such as computing the angle between two vectors, calculating the length of the cross product of two vectors, or finding the distance between two points.