code: public double distance(double p1, double p2) {
      double d = (p1 - p2) * (p1 - p2);
      return Math.sqrt(d);
    }
docs: Calculates the Euclidean distance between two points.
  
  @param p1 The first point.
  @param p2 The second point.
  @return The Euclidean distance.