code: public static double QuasiEuclidean(double x1, double y1, double x2, double y2) {
  
          if (Math.abs(x1 - x2) > Math.abs(y1 - y2)) {
              return Math.abs(x1 - x2) + (Constants.Sqrt2 - 1) * Math.abs(y1 - y2);
          }
          return (Constants.Sqrt2 - 1) * Math.abs(x1 - x2) + Math.abs(y1 - y2);
  
      }
docs: Gets the Quasi-Euclidean distance between two points.
  
  @param x1 X1 axis coordinates.
  @param y1 Y1 axis coordinates.
  @param x2 X2 axis coordinates.
  @param y2 Y2 axis coordinates.
  @return The Quasi-Euclidean distance between x and y.