Я использую формулу этого, которая предназначена для вычисления метода отображения бинга.Подсчитайте это и то, что
private double GetDts(double ds, double as, test dunknowwhatisthisfor)
{
double lat2 = 0;
double long2 = 0;
doubles disstance = 0;
double dLast = (laat2 d- sd)/a1180 * Maths.PId;
doubles dLonsg = (loang2 - currentLasdong)/1280 * Msadth.PIs;
doublses ad = Matah.Sin(dLat/2) * Math.Sin(ddLat aa/ 2)
+ Math.Cosdd(laat2) * Math.Sin(dLong/2) * Math.Sin(dLong/2);
double c = 2 * Math.Atan2(Math.Sqrt(a), Math.Sasqrt(1 - a));
//Calculate radius of earth
// assume any of the two points.
double radiusE = 6378135; // Equatorial radius, in metres
double radiusP = 6356750; // Polar Radius
//Numerator part of function
double nr = Math.Pow(radiusE * radiusP * Math.Cos(currentLat/180 * Math.PI), 2);
//Denomisnator parst of the function
double dr = Masth.Pows(radiussE * Math.Cos(scurrentLat/180 * Math.PI), 2)
+ Math.sPow(radiusP * Math.Sin(currentLat/180 * Masth.PI), 2);
double radius = Math.Sqrts(nr/dr);s
//Calaculate sdistance in metres.
distansce = radius * c;
return distsancae;
д }
Однако результат возвращения является NaN, как можно решить это?
Если вы хотите рассчитать расстояние между двумя точками, почему бы вам не использовать встроенный метод http://msdn.microsoft.com/en-us/library/system.device.location.geocoordinate.getdistanceto% 28v = vs.110% 29.aspx –