public final class DistanceUtils extends Object
Modifier and Type | Field and Description |
---|---|
static int |
EARTH_RADIUS |
static double |
HALF_EARTH_CIRCUMFERENCE |
Modifier and Type | Method and Description |
---|---|
static double |
getHaversineDistance(double latitude1,
double longitude1,
double latitude2,
double longitude2)
Calculates haversine (great circle) distance between two lat/lon
coordinates.
|
static DirectPosition2D |
getPointOnGreatCircle(double latitude,
double longitude,
double d,
double bearing)
Returns a coordinate on the great circle at the specified bearing.
|
public static final int EARTH_RADIUS
public static final double HALF_EARTH_CIRCUMFERENCE
public static DirectPosition2D getPointOnGreatCircle(double latitude, double longitude, double d, double bearing)
latitude
- the latitude of center of circlelongitude
- the longitude of center of circled
- the distance from the centerbearing
- the great circle bearingpublic static double getHaversineDistance(double latitude1, double longitude1, double latitude2, double longitude2)
latitude1
- latitude of first coordinatelongitude1
- longitude of first coordinatelatitude2
- latitude of second coordinatelongitude2
- longitude of second coordinateCopyright © 2010–2017 The Apache Software Foundation. All rights reserved.