DistanceUtils.GetDistance method

Version 1.1.28
.NET Framework 4.8
Namespace Skybrud.Essentials.Maps
Assembly Skybrud.Essentials.dll

GetDistance(IPoint, IPoint)

Static

Calculates the distance in metres between two GPS locations.

public static double GetDistance(IPoint loc1, IPoint loc2)

Parameters

loc1 IPoint

The first location.

loc2 IPoint

The second location.

Returns

The distance in metres between the two locations.

GetDistance(IPoint, IPoint, double)

Static

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)

Static

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)

Static

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.