经典 ASP 中两个纬度/经度点之间的距离
我有两对纬度/经度,想找到它们之间的距离。我一直坚持在这个特定网站上使用经典 ASP。
我发现了大量使用半正矢方程的代码示例,但在 ASP 中却没有(ASP 缺少 ACos
函数,并且没有内置 pi
!我最终得到了一些代码工作,但经过仔细测试证明它是有缺陷的。我对球面几何的理解还不够好,所以有人可以说他们以前在 ASP 中做过这个吗?谢谢。
I have two pairs of latitude/longitude, and want to find the distance between them. I am stuck with using Classic ASP on this particular website.
I found plenty of code examples using the Haversine equation, but not in ASP (which lacks the ACos
function, and doesn't have pi
built in! I eventually got some code working, but after careful testing it proved to be flawed. My understanding of spherical geometry isn't good enough, so please can anyone say if they have done this in ASP before?! Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
哦亲爱的。我简直就是个白痴,在我进入三角学之前,没能发现一些将我的纬度/经度设置为整数的代码。我觉得很愚蠢......
至少这意味着我的代码是正确的,所以我将其发布在这里,以防它对其他人有帮助:
Oh dear. I have just been a complete idiot, and failed to spot a little bit of code that was setting my lat/long to integers before I even got into the trigonometry. I feel very stupid....
At least it means that my code is correct, so I'll post it here in case it helps someone else:
该代码源更完整:距离可以以英里、公里或海里为单位。
http://www.geodatasource.com/developers/asp
This code source is more complete : distance can be in miles, or kilometers, or nautical miles..
http://www.geodatasource.com/developers/asp