I`d like calculate the distance of two geo points. the points are given in longitude and latitude.
the coordinates are:
point 1: 36.578581, -118.291994
As you are using the framework 4.0, I would suggest the GeoCoordinate
class.
// using System.Device.Location;
GeoCoordinate c1 = new GeoCoordinate(36.578581, -118.291994);
GeoCoordinate c2 = new GeoCoordinate(36.23998, -116.83171);
double distanceInKm = c1.GetDistanceTo(c2) / 1000;
// Your result is: 136,111419742602
You have to add a reference to System.Device.dll.