This is the lat/long for Philadelphia: http://www.rcn.montana.edu/resources/tools/coordinates.aspx?nav=11&c=DD&md=24&mdt=Internationa开发者_开发问答l(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?
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.
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.
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:
The distance between these two points is 29.900202340452488
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 roughly 2841 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.
精彩评论