 de.lmu.ifi.dbs.elki.math.geodesy

Class SphericalCosineEarthModel

• All Implemented Interfaces:
EarthModel

public class SphericalCosineEarthModel
extends AbstractEarthModel
A simple spherical earth model using radius 6371009 m.

For distance computations, this variant uses the Cosine formula, which is faster but less accurate than the Haversince or Vincenty's formula.

Since:
0.6.0
Author:
Erich Schubert
• Field Detail

public static final double EARTH_RADIUS
Earth radius approximation in m.
Constant Field Values
• Constructor Detail

• SphericalCosineEarthModel

protected SphericalCosineEarthModel()
Constructor.
• Method Detail

public double[] latLngRadToECEF(double lat,
double lng)
Description copied from interface: EarthModel
Map a radians latitude, longitude pair to 3D X-Y-Z coordinates, using a spherical earth model.

The coordinate system is usually chosen such that the earth rotates around the Z axis and X points to the prime meridian and Equator.

Specified by:
latLngRadToECEF in interface EarthModel
Overrides:
latLngRadToECEF in class AbstractEarthModel
Parameters:
lat - Latitude in radians
lng - Longitude in radians
Returns:
Coordinate triple, in meters.

public double[] latLngRadToECEF(double lat,
double lng,
double h)
Description copied from interface: EarthModel
Map a radians latitude, longitude pair to 3D X-Y-Z coordinates, using a spherical earth model.

The coordinate system is usually chosen such that the earth rotates around the Z axis and X points to the prime meridian and Equator.

Specified by:
latLngRadToECEF in interface EarthModel
Overrides:
latLngRadToECEF in class AbstractEarthModel
Parameters:
lat - Latitude in radians
lng - Longitude in radians
h - Height
Returns:
Coordinate triple, in meters.

public double ecefToLatRad(double x,
double y,
double z)
Description copied from interface: EarthModel
Convert a 3D coordinate pair to the corresponding latitude.
Specified by:
ecefToLatRad in interface EarthModel
Overrides:
ecefToLatRad in class AbstractEarthModel
Parameters:
x - X value
y - Y value
z - Z value
Returns:

public double distanceRad(double lat1,
double lng1,
double lat2,
double lng2)
Description copied from interface: EarthModel
Compute the geodetic distance between two surface coordinates.
Specified by:
distanceRad in interface EarthModel
Overrides:
distanceRad in class AbstractEarthModel
Parameters:
lat1 - Latitude of first in radians.
lng1 - Longitude of first in radians.
lat2 - Latitude of second in radians.
lng2 - Longitude of second in radians.
Returns:
Distance in meters.