@Override public boolean contains(double lat1, double lon1) { return normDist(lat1, lon1) <= normedDist; }
public boolean intersect(BBox b) { // test top intersect if (lat > b.maxLat) { if (lon < b.minLon) { return normDist(b.maxLat, b.minLon) <= normedDist; } if (lon > b.maxLon) { return normDist(b.maxLat, b.maxLon) <= normedDist; } return b.maxLat - bbox.minLat > 0; } // test bottom intersect if (lat < b.minLat) { if (lon < b.minLon) { return normDist(b.minLat, b.minLon) <= normedDist; } if (lon > b.maxLon) { return normDist(b.minLat, b.maxLon) <= normedDist; } return bbox.maxLat - b.minLat > 0; } // test middle intersect if (lon < b.minLon) { return bbox.maxLon - b.minLon > 0; } if (lon > b.maxLon) { return b.maxLon - bbox.minLon > 0; } return true; }
public boolean intersect(Circle c) { // necessary to improve speed? if (!getBounds().intersect(c.getBounds())) { return false; } return normDist(c.lat, c.lon) <= calc.calcNormalizedDist(radiusInMeter + c.radiusInMeter); }
@Override public boolean contains( double lat1, double lon1 ) { return normDist(lat1, lon1) <= normedDist; }
@Override public boolean contains(double lat1, double lon1) { return normDist(lat1, lon1) <= normedDist; }
@Override public boolean contains(double lat1, double lon1) { return normDist(lat1, lon1) <= normedDist; }
public boolean intersect(BBox b) { // test top intersect if (lat > b.maxLat) { if (lon < b.minLon) { return normDist(b.maxLat, b.minLon) <= normedDist; } if (lon > b.maxLon) { return normDist(b.maxLat, b.maxLon) <= normedDist; } return b.maxLat - bbox.minLat > 0; } // test bottom intersect if (lat < b.minLat) { if (lon < b.minLon) { return normDist(b.minLat, b.minLon) <= normedDist; } if (lon > b.maxLon) { return normDist(b.minLat, b.maxLon) <= normedDist; } return bbox.maxLat - b.minLat > 0; } // test middle intersect if (lon < b.minLon) { return bbox.maxLon - b.minLon > 0; } if (lon > b.maxLon) { return b.maxLon - bbox.minLon > 0; } return true; }
public boolean intersect(BBox b) { // test top intersect if (lat > b.maxLat) { if (lon < b.minLon) { return normDist(b.maxLat, b.minLon) <= normedDist; } if (lon > b.maxLon) { return normDist(b.maxLat, b.maxLon) <= normedDist; } return b.maxLat - bbox.minLat > 0; } // test bottom intersect if (lat < b.minLat) { if (lon < b.minLon) { return normDist(b.minLat, b.minLon) <= normedDist; } if (lon > b.maxLon) { return normDist(b.minLat, b.maxLon) <= normedDist; } return bbox.maxLat - b.minLat > 0; } // test middle intersect if (lon < b.minLon) { return bbox.maxLon - b.minLon > 0; } if (lon > b.maxLon) { return b.maxLon - bbox.minLon > 0; } return true; }
public boolean intersect( Circle c ) { // necessary to improve speed? if (!getBounds().intersect(c.getBounds())) { return false; } return normDist(c.lat, c.lon) <= calc.calcNormalizedDist(radiusInKm + c.radiusInKm); }
public boolean intersect(Circle c) { // necessary to improve speed? if (!getBounds().intersect(c.getBounds())) { return false; } return normDist(c.lat, c.lon) <= calc.calcNormalizedDist(radiusInMeter + c.radiusInMeter); }
public boolean intersect(Circle c) { // necessary to improve speed? if (!getBounds().intersect(c.getBounds())) { return false; } return normDist(c.lat, c.lon) <= calc.calcNormalizedDist(radiusInMeter + c.radiusInMeter); }