pythagoras static method

double pythagoras(
  1. double d1,
  2. double d2
)

Calculates the hypothenuse as of the Pythagorean theorem.

@param d1 the length of the first leg. @param d2 the length of the second leg. @return the length of the hypothenuse.

Implementation

static double pythagoras(double d1, double d2) {
  return math.sqrt(math.pow(d1, 2.0) + math.pow(d2, 2.0));
}