我正在计算两个GeoCoordinates之间的距离.我正在针对其他3-4个应用测试我的应用.当我计算距离时,我计算得到的平均值为3.3英里,而其他应用程序的距离为3.5英里.这与我正在尝试执行的计算有很大不同.有没有好的类库来计算距离?我在C#中计算它是这样的:
public static double Calculate(double sLatitude,double sLongitude, double eLatitude,
double eLongitude)
{
var radiansOverDegrees = (Math.PI / 180.0);
var sLatitudeRadians = sLatitude * radiansOverDegrees;
var sLongitudeRadians = sLongitude * radiansOverDegrees;
var eLatitudeRadians = eLatitude * radiansOverDegrees;
var eLongitudeRadians = eLongitude * radiansOverDegrees;
var dLongitude = eLongitudeRadians - sLongitudeRadians;
var dLatitude = eLatitudeRadians - sLatitudeRadians;
var result1 = Math.Pow(Math.Sin(dLatitude / 2.0), 2.0) +
Math.Cos(sLatitudeRadians) * Math.Cos(eLatitudeRadians) *
Math.Pow(Math.Sin(dLongitude / 2.0), 2.0);
// Using 3956 as the number of miles around the …Run Code Online (Sandbox Code Playgroud) 我画了两点A(x,y)--- B(x,y)之间的一条线现在我有第三个点C(x,y).我想知道如果C位于A和B之间的线上.我想用java语言来做.我找到了几个类似的答案.但是,都有一些问题,没有人是完美的.
我真的很新用于使用API所以在查看谷歌地图Api页面后我不确定是否有设计用于C#的API.如果我可以在C#上使用谷歌地图API,我不需要谷歌地图在我的应用程序上显示所有我需要知道. 这是我想要使用的那个
我在很多地方寻找它,但我能找到的只是使用Gmaps的替代品,但那不是我想要的.
¿有可能使用它吗?