Click or drag to resize

DistanceGetHaversineDistance Method (Double, Double, Double, Double)

Calculates the haversine distance between to points, specified as lon/lat, aka WGS84, aka EPSG:4326.

Namespace:  Ptv.Components.Projections
Assembly:  Ptv.Components.Projections (in Ptv.Components.Projections.dll) Version: 1.7.10.0
Syntax
public static double GetHaversineDistance(
	double x0,
	double y0,
	double x1,
	double y1
)

Parameters

x0
Type: SystemDouble
Longitude of first point, in degress
y0
Type: SystemDouble
Latitude of first point, in degress
x1
Type: SystemDouble
Longitude of second point, in degress
y1
Type: SystemDouble
Latitude of second point, in degress

Return Value

Type: Double
Haversine distance in [km].
Examples
double d_Karlsruhe_Berlin = GetHaversineDistance(8.40376, 49.00808, 13.4114, 52.5234);
double d_Barcelona_Moskau = GetHaversineDistance(2.16992, 41.38793, 37.6177, 55.75586);
See Also