Double-precision floating point (±1.7E±308, ~15 decimal digits)
1st Parameter
The first coordinate of the point
2nd Parameter Type : double
Double-precision floating point (±1.7E±308, ~15 decimal digits)
2nd Parameter
The second coordinate of the point
Read more about parameters of hypot in parameters section
The hypotfunction in C language Calculates the hypotenuse of a right-angled triangle given its legs.
The hypot function computes the square root of the sum of the squares of x and y, without undue overflow or underflow. It is equivalent to sqrt(x*x + y*y), but is more robust against intermediate overflow or underflow.
The hypotfunction takes 2
parameters:
•
double `x`: The first coordinate of the point
•
double `y`: The second coordinate of the point
Calculates the Euclidean distance from the origin (0, 0) to the point (`x`, `y`) in a 2D Cartesian coordinate system. Mathematically, it computes `sqrt(x*x + y*y)` without intermediate overflow or underflow.
The hypot function return value :
Returns the length of the hypotenuse of a right-angled triangle with legs of length x and y
Output
This example demonstrates the basic usage of hypot to calculate the hypotenuse of a 3-4-5 right triangle.