为什么博尔德 到 费城 之间的距离是 7 英里?我的数学算错了吗?
纬度和经度是正确的(您可以在 Google 地图中查看)。 UTM_east 和 UTM_north 对于两者来说也是正确的。
现在,将 UTM 代入距离公式:http://www.basic- math.com/distance-formula-calculator.html
您将得到以米为单位的距离,即 7 英里。
博尔德到底为何距费城 7 英里?
This is the lat/long for Philadelphia: http://www.rcn.montana.edu/resources/tools/coordinates.aspx?nav=11&c=DD&md=24&mdt=International(1924)-Hayford(1909)&lat=39.947648&lath=N&lon=-75.151978&lonh=W
This is the lat/long for Boulder: http://www.rcn.montana.edu/resources/tools/coordinates.aspx?nav=11&c=DD&md=24&mdt=International(1924)-Hayford(1909)&lat=40.0149856&lath=N&lon=-105.2705456&lonh=W
That lat and long are correct (You can check it in Google Maps). UTM_east and UTM_north are also correct for both.
Now, plug the UTMs into the distance formula here: http://www.basic-mathematics.com/distance-formula-calculator.html
And you will get distance in meters, which is 7 miles.
Why on earth is Boulder 7 miles away from Philadelphia?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您不能像这样插入 UTM 坐标,因为这两个城市不在同一个 UTM 区域。
编辑:
并且,正如其他人所指出的,即使它们位于同一区域,您也不应该只对 UTM 坐标应用平面笛卡尔距离计算,因为 UTM 坐标基于圆柱投影。我只是指出导致您错误的最大因素是区域问题。
You can't just plug in the UTM coordinates like that because these two cities are not in the same UTM Zone.
EDIT:
And, as everyone else has pointed out, even if they were in the same zone, you shouldn't just apply a planar, cartesian distance calculation to the UTM coordinates because the UTM coordinates are based on a cylindrical projection. I was just pointing out that the largest contributing factor to your error was the zone issue.
纬度和经度是球面坐标系,您使用的公式仅适用于平面。您需要使用haversine 公式。
Latitude and Longitude are a spherical coordinate system and the formula you're using only works on a plane. You need to use the haversine formula.
当我计算两点之间的距离(就像它们在标准笛卡尔平面上一样)时,我得到的距离为 29.9,这非常接近该工具的结果:
首先,在球形物体上使用笛卡尔距离计算器不会给出好的结果。 :)(撇开地球不是球形不谈,但它也肯定不是平坦的。)
但是,让我们假设使用笛卡尔距离“足够好”,结果在这里以我们输入的任何单位进行测量。并且知道 1 度大约为 111 km,我们可以快速猜测博尔德和费城之间的距离大约为
3318.9 km
。鉴于 Google 两者之间的行车路线大约为2841 公里
,您可以立即明白为什么应用笛卡尔距离算法在球体上不起作用,以及为什么需要使用 haversine 公式。When I calculate the distance between the two points as if they were on a standard Cartesian plane, I get a distance of 29.9, which is really close to the tool's result:
First, using a Cartesian distance calculator on a spherical object isn't going to give good results. :) (Leaving aside that the Earth isn't spherical, but it sure isn't flat either.)
BUT, let's assume for a second that using Cartesian distance is "good enough", the results here are measured in whatever units we input. And knowing that 1 degree is roughly 111 km, we get a quick guess that the distance between Boulder and Philadelphia is roughly
3318.9 km
. Given that Google's driving directions between the two is roughly2841 km
, you can immediately see why applying Cartesian distance algorithms won't work on a sphere, and why you need to use the haversine formula.