sqrt(x2 +y2)

ReturnMethodSummary
static doublehypot(double x, double y)Returns sqrt(x2 +y2) .

public class Main {
  public static void main(String[] args) {

    System.out.println(Math.hypot(2,2));
  }
}

The output:


2.8284271247461903
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.