Skip to content

Instantly share code, notes, and snippets.

@SamKr
Created November 2, 2018 10:16
Show Gist options
  • Save SamKr/f4071fc797fc24367d723891fefba62e to your computer and use it in GitHub Desktop.
Save SamKr/f4071fc797fc24367d723891fefba62e to your computer and use it in GitHub Desktop.
Calculates distance between 2 geopoints
using System.Device.Location;
internal static double GetDistance(double lat, double lon)
{
var sCoord = new GeoCoordinate(Variables.HomeLat, Variables.HomeLon);
var eCoord = new GeoCoordinate(lat, lon);
return sCoord.GetDistanceTo(eCoord);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment