@Test public void testDistance() { assertTrue(MathUtils.distance(0, 0, 3, 4) == 5.0D); assertTrue(MathUtils.distance(0.0D, 0.0D, 3.0D, 4.0D) == 5.0D); assertTrue(MathUtils.distance(Point.valueOf(0, 0), Point.valueOf(3, 4)) == 5.0D); }
public static double distance(int x1, int y1, int x2, int y2) { final double x = Math.abs(x1 - x2); final double y = Math.abs(y1 - y2); return Math.sqrt(x * x + y * y); }
MathUtils { public static double distance(int x1, int y1, int x2, int y2) { final double x = Math.abs(x1 - x2); final double y = Math.abs(y1 - y2); return Math.sqrt(x * x + y * y); } }
MathUtils { public static double distance(int x1, int y1, int x2, int y2) { final double x = Math.abs(x1 - x2); final double y = Math.abs(y1 - y2); return Math.sqrt(x * x + y * y); }  }
MathUtils { public static double distance(int x1, int y1, int x2, int y2) { final double x = Math.abs(x1 - x2); final double y = Math.abs(y1 - y2); return Math.sqrt(x * x + y * y); }  static int addExact(int x, int y); static long addExact(long x, long y); static int multiplyExact(int x, int y); static long multiplyExact(long x, long y); static double distance(int x1, int y1, int x2, int y2); static double distance(double x1, double y1, double x2, double y2); static double distance(Point p1, Point p2); static boolean adjacent(int x1, int y1, int x2, int y2); static boolean adjacent(Point p1, Point p2); static int floorInt(double a); static long floorLong(double a); static int ceilInt(double a); static long ceilLong(double a); static float formatScale(float value, int newScale); static float formatScale(float value, int newScale, RoundingMode mode); static double formatScale(double value, int newScale); static double formatScale(double value, int newScale, RoundingMode mode); static Map<T, Long> plunder(Map<T, Long> resources, long max, Map<T, Integer> ratio); static double longToDouble(long value, double ratio); static double permillage(long value); static double percentage(long value); }
MathUtils { public static double distance(int x1, int y1, int x2, int y2) { final double x = Math.abs(x1 - x2); final double y = Math.abs(y1 - y2); return Math.sqrt(x * x + y * y); }  static int addExact(int x, int y); static long addExact(long x, long y); static int multiplyExact(int x, int y); static long multiplyExact(long x, long y); static double distance(int x1, int y1, int x2, int y2); static double distance(double x1, double y1, double x2, double y2); static double distance(Point p1, Point p2); static boolean adjacent(int x1, int y1, int x2, int y2); static boolean adjacent(Point p1, Point p2); static int floorInt(double a); static long floorLong(double a); static int ceilInt(double a); static long ceilLong(double a); static float formatScale(float value, int newScale); static float formatScale(float value, int newScale, RoundingMode mode); static double formatScale(double value, int newScale); static double formatScale(double value, int newScale, RoundingMode mode); static Map<T, Long> plunder(Map<T, Long> resources, long max, Map<T, Integer> ratio); static double longToDouble(long value, double ratio); static double permillage(long value); static double percentage(long value); static final double ONE; static final double HUNDRED; static final double THOUSAND; static final double TEN_THOUSAND; static final double MILLION; }