code: public static double getDistance(double x1, double y1, double x2, double y2)
      {
          final double x = x2 - x1;
          final double y = y2 - y1;
  
          return StrictMath.sqrt(x * x + y * y);
      }
docs: Get distance of two points.
  
  @param x1 The point 1 x.
  @param y1 The point 1 y.
  @param x2 The point 2 x.
  @param y2 The point 2 y.
  @return The distance between them.