Java StrictMath.hypot(double x, double y)
Syntax
StrictMath.hypot(double x, double y) has the following syntax.
public static double hypot(double x, double y)
Example
In the following code shows how to use StrictMath.hypot(double x, double y) method.
/*w w w .j a va 2 s . c o m*/
public class Main {
public static void main(String[] args) {
double d1 = 3, d2 = 4, d3 = 6;
System.out.println("hypotenuse value of d1 and d2 = " +
StrictMath.hypot(d1, d2));
System.out.println("hypotenuse value of d2 and d3 = " +
StrictMath.hypot(d2, d3));
}
}
The code above generates the following result.