DistanceUtils.GetDistance method
Namespace | Skybrud.Essentials.Maps |
---|---|
Assembly | Skybrud.Essentials.dll |
GetDistance(IPoint, IPoint)
Calculates the distance in metres between two GPS locations.
public static double GetDistance(IPoint loc1, IPoint loc2)
Returns
The distance in metres between the two locations.
GetDistance(IPoint, IPoint, double)
Calculates the distance in metres between two GPS points on a spheroid.
public static double GetDistance(IPoint loc1, IPoint loc2, double radius)
Parameters
loc1
IPoint
The first location.
loc2
IPoint
The second location.
radius
Double
The equatorial radius of the spheroid.
Returns
The distance in metres between the two locations.
GetDistance(double, double, double, double)
Calculates the distance in metres between two GPS locations.
public static double GetDistance(double lat1, double lng1, double lat2, double lng2)
Parameters
lat1
Double
The latitude of the first location.
lng1
Double
The longitude of the first location.
lat2
Double
The latitude of the second location.
lng2
Double
The longitude of the second location.
Returns
The distance in metres between the two locations.
GetDistance(double, double, double, double, double)
Calculates the distance in metres between two GPS points on a spheroid.
public static double GetDistance(double lat1, double lng1, double lat2, double lng2, double radius)
Parameters
lat1
Double
The latitude of the first location.
lng1
Double
The longitude of the first location.
lat2
Double
The latitude of the second location.
lng2
Double
The longitude of the second location.
radius
Double
The equatorial radius of the spheroid.
Returns
The distance in metres between the two points.