public double distanceToAsDouble(final IGeoPoint other) {
        final double lat1 = DEG2RAD * getLatitude();
        final double lat2 = DEG2RAD * other.getLatitude();
        final double lon1 = DEG2RAD * getLongitude();
        final double lon2 = DEG2RAD * other.getLongitude();
        return RADIUS_EARTH_METERS * 2 * Math.asin(Math.min(1, Math.sqrt(
                Math.pow(Math.sin((lat2 - lat1) / 2), 2)
                        + Math.cos(lat1) * Math.cos(lat2)
                        * Math.pow(Math.sin((lon2 - lon1) / 2), 2)
        )));
    }
@Test
    public void test_distanceTo_Equator_Smaller() {
        final double ratioDelta = 1E-5;
        final int iterations = 10;
        final double latitude = 0;
        double longitudeIncrement = 1;
        for (int i = 0; i < iterations; i++) {
            final double longitude1 = getRandomLongitude();
            final double longitude2 = longitude1 + longitudeIncrement;
            longitudeIncrement /= 10.;
            final GeoPoint target = new GeoPoint(latitude, longitude1);
            final GeoPoint other = new GeoPoint(latitude, longitude2);
            final double diff = getCleanLongitudeDiff(longitude1, longitude2);
            final double expected = GeoConstants.RADIUS_EARTH_METERS * diff * MathConstants.DEG2RAD;
            if (expected < minimumDistance) {
                continue;
            }
            final double delta = expected * ratioDelta;
            assertEquals("distance between " + target + " and " + other,
                    expected, target.distanceToAsDouble(other), delta);
        }
    }