public class LatLongDistance
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static double |
R_EARTH_M
Mean radius of the Earth (at sea level) in meters.
|
Constructor and Description |
---|
LatLongDistance() |
Modifier and Type | Method and Description |
---|---|
static double |
computeDirection(double lat1,
double long1,
double lat2,
double long2)
Compute the initial compass bearing of the vector between one point and
a second point, relative to True North.
|
static double |
computeDistance(double lat1,
double long1,
double lat2,
double long2)
Compute the distance between two points on the surface of the Earth, using the WGS84
model.
|
public static final double R_EARTH_M
public static double computeDistance(double lat1, double long1, double lat2, double long2)
lat1
- latitude of the first point in degrees Northlong1
- longitude of the first point in degrees East (negative means West)lat2
- latitude of the second point in degrees Northlong2
- longitude of the second point in degrees East (negative means West)public static double computeDirection(double lat1, double long1, double lat2, double long2)
lat1
- latitude of the first point in degrees Northlong1
- longitude of the first point in degrees East (negative means West)lat2
- latitude of the second point in degrees Northlong2
- longitude of the second point in degrees East (negative means West)