public class WGS84 extends Object
Constructor and Description |
---|
WGS84() |
Modifier and Type | Method and Description |
---|---|
static double |
haversineDistance(double lon1,
double lat1,
double lon2,
double lat2)
Calculate the distance in meters from (lon1, lat1) to (lon2, lat2) using
the haversine formula and a mean earth radius of 6371008.67 meters.
|
static double |
lat2merc(double lat)
The inverse of
merc2lat . |
static double |
lat2merc(double lat,
double worldsize)
The inverse of
merc2lat . |
static double |
lon2merc(double lon)
The inverse of
merc2lon . |
static double |
lon2merc(double lon,
double worldsize)
The inverse of
merc2lon . |
static double |
merc2lat(double y)
Convert a position on the unit plane to a longitude.
|
static double |
merc2lat(double y,
double worldsize)
Convert a position on the plane to a longitude.
|
static double |
merc2lon(double x)
Convert a position on the unit plane to a longitude.
|
static double |
merc2lon(double x,
double worldsize)
Convert a position on the plane to a longitude.
|
public static double merc2lon(double x)
x
- the position on the plane (interval is [0..1]
).public static double merc2lon(double x, double worldsize)
x
- the position on the plane (interval is
[0..worldsize]
).worldsize
- a bound used to calculate the relative position of
x
on the Mercator-plane.public static double merc2lat(double y)
y
- the position on the plane (interval is [0..1]
).public static double merc2lat(double y, double worldsize)
y
- the position on the plane (interval is
[0..worldsize]
).worldsize
- a bound used to calculate the relative position of
y
on the Mercator-plane.public static double lon2merc(double lon)
merc2lon
.lon
- the longitude to convert.[0..1]
).public static double lon2merc(double lon, double worldsize)
merc2lon
.lon
- the longitude to convert.worldsize
- the size of the Mercator-plane used to calculate the relative
position x
.[0..worldsize]
).public static double lat2merc(double lat)
merc2lat
.lat
- the latitude to convert.[0..1]
).public static double lat2merc(double lat, double worldsize)
merc2lat
.lat
- the latitude to convert.worldsize
- the size of the Mercator-plane used to calculate the relative
position x
.[0..worldsize]
).public static double haversineDistance(double lon1, double lat1, double lon2, double lat2)
lon1
- the first longitude.lat1
- the first latitude.lon2
- the second longitude.lat2
- the second latitude.