Geobox { public static double distance(DLocation p1, DLocation p2) { double p1lat = Math.toRadians(p1.getLatitude()); double p1lon = Math.toRadians(p1.getLongitude()); double p2lat = Math.toRadians(p2.getLatitude()); double p2lon = Math.toRadians(p2.getLongitude()); return distance(p1lat, p1lon, p2lat, p2lon); }  static long getMask(float x, float base, int bits); static long getHash(float lat, float lng, int bits); static Set<Long> getTuple(float lat, float lng, int bits); static double distance(DLocation p1, DLocation p2); static double makeDoubleInRange(double d); static int getCellSize(int bits); static double getCellSize(int bits, double latitude); static double distance(double p1lat, double p1lon, double p2lat, double p2lon); static final int RADIUS; static final int D; @Deprecated
    static final int BITS_10_39km; @Deprecated
    static final int BITS_12_10km; @Deprecated
    static final int BITS_15_1224m; @Deprecated
    static final int BITS_17_307m; @Deprecated
    static final int BITS_18_154m; @Deprecated
    static final int BITS_19_77m; @Deprecated
    static final int BITS_20_39m; @Deprecated
    static final int BITS_22_10m; @Deprecated
    static final int BITS_23_53dm; @Deprecated
    static final int BITS_24_32dm; static final int BITS_0_40075004m; static final int BITS_1_20037502m; static final int BITS_2_10018751m; static final int BITS_3_5009375m; static final int BITS_4_2504687m; static final int BITS_5_1252343m; static final int BITS_6_626171m; static final int BITS_7_313085m; static final int BITS_8_156542m; static final int BITS_9_78271m; static final int BITS_10_39135m; static final int BITS_11_19567m; static final int BITS_12_9783m; static final int BITS_13_4891m; static final int BITS_14_2445m; static final int BITS_15_1222m; static final int BITS_16_611m; static final int BITS_17_305m; static final int BITS_18_152m; static final int BITS_19_76m; static final int BITS_20_38m; static final int BITS_21_19m; static final int BITS_22_9m; static final int BITS_23_4m; static final int BITS_24_2m; static final int BITS_25_1m; static final int BITS_26_0m; }
@Test public void testGetDistance() { final DLocation P0 = new DLocation(56.34f, 15.05f); final DLocation P1 = new DLocation(56.387f, 15.05f); final DLocation P2 = new DLocation(56.3445f, 15.05f); final DLocation P3 = new DLocation(56.34043f, 15.05f); final DLocation P4 = new DLocation(56.34001f, 15.05f); assertEquals(5232.0f, Geobox.distance(P0, P1), 0.2f); }