@Override public Circle circle(double x, double y, double distance) { GeoCircle circle; if (planetModel.isSphere()) { circle = GeoCircleFactory.makeGeoCircle(planetModel, y * DistanceUtils.DEGREES_TO_RADIANS, x * DistanceUtils.DEGREES_TO_RADIANS, distance * DistanceUtils.DEGREES_TO_RADIANS); } else { //accuracy is defined as a linear distance in this class. At tiny distances, linear distance //can be approximated to surface distance in radians. circle = GeoCircleFactory.makeExactGeoCircle(planetModel, y * DistanceUtils.DEGREES_TO_RADIANS, x * DistanceUtils.DEGREES_TO_RADIANS, distance * DistanceUtils.DEGREES_TO_RADIANS, circleAccuracy * DistanceUtils.DEGREES_TO_RADIANS); } return new Geo3dCircleShape(circle, context); }
@Override public void reset(double x, double y, double radiusDEG) { shape = GeoCircleFactory.makeGeoCircle(shape.getPlanetModel(), y * DistanceUtils.DEGREES_TO_RADIANS, x * DistanceUtils.DEGREES_TO_RADIANS, radiusDEG * DistanceUtils.DEGREES_TO_RADIANS); center = null; boundingBox = null; }
/** * Convert input parameters to a circle. * @param latitude latitude at the center: must be within standard +/-90 coordinate bounds. * @param longitude longitude at the center: must be within standard +/-180 coordinate bounds. * @param radiusMeters maximum distance from the center in meters: must be non-negative and finite. * @return the circle. */ static GeoCircle fromDistance(final double latitude, final double longitude, final double radiusMeters) { GeoUtils.checkLatitude(latitude); GeoUtils.checkLongitude(longitude); return GeoCircleFactory.makeGeoCircle(PlanetModel.WGS84, fromDegrees(latitude), fromDegrees(longitude), fromMeters(radiusMeters)); }