Calculate distance from coordinates

Sweetnuff38

Registered User.
Local time
Today, 01:46
Joined
Dec 7, 2007
Messages
74
I am trying to figure out a way to calculate distance from coordinates. I have spent my afternoon googling and everything I have found appears very complicated.

Am I just overthinking this and freaking out, or is this as complicated as it appears?

I have the cities, coordinates.. just need some way to do the calculation to determine the distance in statute miles.

Appreciate any direction to accomplish this.

Thanks
Tracy
 
By coordinates do you mean lattitude and longitude? Or some other kind of grid?

A simple rectangular grid such localised map that approximates to a flat surface just requires Pythagoras's Theorem and knowlege of the scale.

However Lattitude and Longitude is relatively complex because the distance between lines of longitude varies with lattitude. Surface curvature is also a factor. It needs to be done with spherical geometry.
 
the reason this may seem strange is that the formulas you have found to calculate earth circle distances based on lats longs, dont seem to have a constant in there anywhere - so you wonder how they yield a distance

this comes back to a calculation based on the diameter and hence the circumfrenece of the earth. offhand, i think the earth has a diameter of just under 8000 miles, and a circumfrence of about 25000 miles

a nautical mile represents the great earth circle distance covered in a minute (ie 1/60 of a degree) of this total (which is about 1.15 earth miles)


Hence the calculation you have obtained calcluates the number of minutes of arc between two coordinates - which is directly equivalent to the number of nautical miles - which is why they are full of sines, cosines, tangents and so on.

http://en.wikipedia.org/wiki/Nautical_mile

you then need some conversion factor to change this into whatever distance scale you are actually using.

obviously the fact that the earth is not a true sphere affects the calculations slightly. I am not sure whether tthe calculations take this into account. There is also a slight difference caused by change of altitude between two places - so I expect the calculations evaluates distances at sea level.
 
I used to work in this field. Part of the problem is that ANY computation involving latitude and longitude is based on an approximation (called a projection in navigation terms). A "flat map" of a spherical surface is ALWAYS distorted because what you see on the map is a projection of a sphere, a conversion of three dimensions into two. Invariable, when you start "folding" dimensions like that, distortion creeps in.

The "obvious" distance between two points on the map gets even less obvious when you realize that at least three different popular ways exist to project the surface of the sphere onto the map: Mercator (Conical), Lambert (Cylindrical), and Cassini-Soldner (Hyperbolic/Asymptotic). Each is geometrically different. Therefore, your question

Am I just overthinking this and freaking out, or is this as complicated as it appears?

has this answer: It is at least as complicated as it appears if not more so.

For that reason, using spherical geometry is preferred because it is usually better and more accurate, even given the distortion of the Earth from a true sphere. The formulae in question are better understood and documented, not to mention that they are reasonably available from many on-line sources. Therefore, I would definitely follow GAH's link and pick up the spherical trig formulae.
 
There is a small sample DB here that manges lat/long waypoints and can caclulate the distance between any two waypoints in the DB.
 

Users who are viewing this thread

Back
Top Bottom