public bool equals(LatBounds LatBounds) { return this.isEmpty() ? LatBounds.isEmpty() : Math.Abs(LatBounds.getSw() - this._swLat) + Math.Abs(this._neLat - LatBounds.getNe()) <= SphericalGeometry.EQUALS_MARGIN_ERROR; }
public bool intersects(LatBounds LatBounds) { return this._swLat <= LatBounds.getSw() ? LatBounds.getSw() <= this._neLat && LatBounds.getSw() <= LatBounds.getNe() : this._swLat <= LatBounds.getNe() && this._swLat <= this._neLat; }
/** * LatLngSw South West LatLng object * LatLngNe North East LatLng object */ public LatLngBounds(LatLng LatLngSw = null, LatLng LatLngNe = null) { if (LatLngSw != null) { LatLngNe = (LatLngNe!=null) ? LatLngSw : LatLngNe; double sw = SphericalGeometry.clampLatitude(LatLngSw.Lat); double ne = SphericalGeometry.clampLatitude(LatLngNe.Lat); this._LatBounds = new LatBounds(sw, ne); sw = LatLngSw.Lng; ne = LatLngNe.Lng; if (360 <= ne - sw) { this._LngBounds = new LngBounds(-180, 180); } else { sw = SphericalGeometry.wrapLongitude(sw); ne = SphericalGeometry.wrapLongitude(ne); this._LngBounds = new LngBounds(sw, ne); } } else { this._LatBounds = new LatBounds(1, -1); this._LngBounds = new LngBounds(180, -180); } }