How to calculate the length of hypotenuse?
Hypot is a mathematical function defined to calculate the length of the hypotenuse of a right-angle triangle. It was designed to avoid errors arising due to limited precision calculations performed on computers.
The Math.hypot(double x, double y) return the sqrt(x2 + y2) without intermediate overflow or underflow. The result will be same with this calculation
Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)).