Forum: travel.stackexchange.com
Tags: <air-travel><planning>
Title: How to calculate the air-line distance between two places?
Question: A lot of the time, I'm looking for a way to calculate the air-line distance between two places, most often city centers.  For example when I flew from Zurich to Helsinki I wanted to know how far it was. With Google Maps I can do it but not for the air-line distance.  So does anyone know a tool for doing this or can give me advice on how to do it manually using the geo coordinates? Then I could write my own little tool.

Answers:
sents: text: The best place for these calculations is the "Great Circle Mapper" website.
text: http://www.gcmap.com/
text: To find the distance between two or more airports just enter them with dashes between them.
text: eg, JFK-DFW or SFO-IAD-LHR
text: You can do multiple trips at once by separating them with commas.
text: JKF-DFW,SFO-IAD-LHR
answer_details: author: travel.stackexchange.com/users/984/Doc
score: 18
sents: text: To All the repliers reccomending Great Circle math, You are only partly right.
text: The distance between two points on a sphere is found by GC Maths, however the OP specifically asked for the air-line distance.
text: This is found by first finding all the points visited en-route to the destination and then calculating GC distances for all of the route pairs.
text: For example a flight from London to New York does not follow the great circle path between the two points.
text: It follows a set of points, which may include Navaids, Waypoints, Airways, Departure routes, Arrival routes, lat/long fixes and range bearing points.
text: see Flight Plan for more info.
text: So you would need to contact the airline involved and ask nicely for the flight plan used, and find the lat longs for each of the points visited.
answer_details: author: travel.stackexchange.com/users/987/NWS
score: 13
sents: text: Many airlines include this information in their schedules.
text: For example, Air Canada lets you download a PDF of their entire schedule.
text: Here's a clip from it: I suggest searching the website of the airline you intend to use.
text: Any tool based on actually how far apart the cities are may be as much as 20-30 miles different from the airline distance.
answer_details: author: travel.stackexchange.com/users/46/Kate Gregory
score: 11
sents: text: If you want to calculate it yourself, then the spherical law of cosines is probably the easiest way to go about it.
text: It'll likely be accurate enough for your needs, and is really simple.
text: If you want it in python, try this code of mine (you'd want calculate_distance_and_bearing )
text: Likely you'll also want the location information for the various airports of interest.
text: I've tended to use The Global Airport Database in the past for this sort of thing.
answer_details: author: travel.stackexchange.com/users/26/Gagravarr
score: 7
sents: text: If you want to do this calculation for flights, you would have to use the Spherical law of cosines as Gagravarr mentioned.
text: However, if you want to write your own little tool and want to plot a line on a map
text: then it gets a bit tricky.
text: You would have to use a Lambert projection map to draw a straight line from A to B on it.
text: The issue with the Lambert conformal conic projection is that those maps are only accurate along the two reference parallels, and the further you go away from them the less precise they are.
text: This is usually not and issue on small maps that only cover 100x100km, but the larger the map the bigger the error margin gets.
text: This has something to do with the fact that the earth is round, and you cannot do an exact 1:1 mapping from a round to a flat surface.
text: Google maps (and all nautical maps) uses a Cylindrical Map projection , this means you would have to draw curves on the map to get the same route as you would with a straight line on a Lambert projection.
answer_details: author: travel.stackexchange.com/users/466/iHaveacomputer
score: 5
sents: text: Why don't you use this tool with Latitude and Longitude?
answer_details: author: travel.stackexchange.com/users/983/Helios
score: 4
sents: text: You can also draw such lines (called geodesics ) in Google Maps using this site .
text: See also Is there a way to make a line in Google Maps account for the curvature of the Earth? on Stack Exchange Web Applications .
answer_details: author: travel.stackexchange.com/users/1008/Itamar
score: 4
sents: text: In addition to the options already mentioned, milecalc.com will also do this calculation, using the Great Circle distance, which is the value typically used for frequent flyer mileage calculation etc.
answer_details: author: travel.stackexchange.com/users/2555/Andrew Ferrier
score: 3
sents: text: I use luftlinie.org or its anglophpne brother distance.to .
answer_details: author: travel.stackexchange.com/users/11860/Maître Peseur
score: 2
sents: text: See here:
text: http://www.movable-type.co.uk/scripts/latlong.html var R = 6371;
text: //
text: Earth's average radius in kmvar dLat =
text: (lat2-lat1).toRad();var dLon = (lon2-lon1).toRad();var lat1 = lat1.toRad();var lat2 = lat2.toRad();var a = Math.sin(dLat/2)
text: * Math.sin(dLat/2)
text: + Math.sin(dLon/2)
text: * Math.sin(dLon/2)
text: * Math.cos(lat1)
text: * Math.cos(lat2); var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
text: var d = R * c;
answer_details: author: travel.stackexchange.com/users/2885/Quandary
score: 2
sents: text: When I need to measure the distance I use wdistances.com .
text: Distance from Zurich to Helsinki is 1104,42 miles air line distance.
answer_details: author: travel.stackexchange.com/users/22725/Carl
score: 2

Summary of the answers:
If you want to calculate it yourself, then the  spherical law of cosines  is probably the easiest way to go about it. You can also use the 'Great Circle Mapper', milecalc.com, wdistances.com,  luftlinie.org  or its anglophpne brother  distance.to. Many airlines use this to calculate airmiles and include it in their schedules.
Tools already exist for calculating the airline distance between two points and many airlines include this information in their schedule. However, should you wish to calculate it yourself, you need to use the spherical law of cosines