code: public static double Minkowski(double x1, double y1, double x2, double y2, int r) {
          double sum = Math.pow(Math.abs(x1 - x2), r);
          sum += Math.pow(Math.abs(y1 - y2), r);
          return Math.pow(sum, 1 / r);
      }
docs: Gets the Minkowski distance between two points.
  
  @param x1 X1 axis coordinate.
  @param y1 Y1 axis coordinate.
  @param x2 X2 axis coordinate.
  @param y2 Y2 axis coordinate.
  @param r  Order between two points.
  @return The Minkowski distance between x and y.