我需要使用c#找到Windows 8.1应用程序中2点之间的距离(Km),所以我使用了下面的函数,但是返回的值不正确请求:
public static double DistanceTo(Double latitude1, Double longitude1, Double latitude2, Double longitude2)
{
var a = latitude1 - latitude2;
var b = longitude1 - longitude2;
return Math.Sqrt(a * a + b * b);
}
Run Code Online (Sandbox Code Playgroud) c# ×1