Hi,
I have drawn a MapEllipseGeometry on the Map at 100 km radius. If I then calculate the distance between the centre and the edge I am getting a result of 100.95 km. (I am determining the edge point latitude and longitude by dragging a pin to the edge to get the 2nd )
I am using a method suggested in these forums to calculate the distance between the 2 points.
public static double DistanceBetween(double lat1, double lng1, double lat2, double lng2)
{
Location northEast = new Location(Math.Max(lat1, lat2), Math.Max(lng1, lng2));
Location southWest = new Location(Math.Min(lat1, lat2), Math.Min(lng1, lng2));
LocationRect rect = new LocationRect(northEast, southWest);
rect.MapControl = new RadMap();
double distance = Math.Sqrt(rect.Width * rect.Width + rect.Height * rect.Height);
return distance;
}
This is a about a 1% error, any ideas why this could be the case?
Thanks
Anthony
I have drawn a MapEllipseGeometry on the Map at 100 km radius. If I then calculate the distance between the centre and the edge I am getting a result of 100.95 km. (I am determining the edge point latitude and longitude by dragging a pin to the edge to get the 2nd )
I am using a method suggested in these forums to calculate the distance between the 2 points.
public static double DistanceBetween(double lat1, double lng1, double lat2, double lng2)
{
Location northEast = new Location(Math.Max(lat1, lat2), Math.Max(lng1, lng2));
Location southWest = new Location(Math.Min(lat1, lat2), Math.Min(lng1, lng2));
LocationRect rect = new LocationRect(northEast, southWest);
rect.MapControl = new RadMap();
double distance = Math.Sqrt(rect.Width * rect.Width + rect.Height * rect.Height);
return distance;
}
This is a about a 1% error, any ideas why this could be the case?
Thanks
Anthony