Java sqr sqrt2sq(double x, double y)

Here you can find the source of sqrt2sq(double x, double y)

Description

sqrtsq

License

Open Source License

Declaration

public static double sqrt2sq(double x, double y) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static double sqrt2sq(double x, double y) {
        return sqrt(sq(x) + sq(y));
    }/* w  w w  .j  ava2  s  . c om*/

    public static double sqrt(double d) {
        if (d == 0D)
            return 0D;
        else if (d == 1D)
            return 1D;
        else
            return Math.sqrt(d);
    }

    public static double sq(double f) {
        return f * f;
    }

    public static double sq(double f, int i) {
        if (i == 2)
            return sq(f);
        double f1 = 1D;
        for (int j = 0; j < i; j++)
            f1 *= f;
        return f1;
    }
}

Related

  1. sqrt(long val)
  2. sqrt(long x)
  3. sqrt(Short a)
  4. sqrt(short value)
  5. sqrt2(float x)
  6. sqrt_double(double d)
  7. sqrt_float(float value)
  8. sqrt_long(final long x)
  9. sqrtInt(Integer num)