5

I want to overlay great circle arcs between airports on a map using longitudes and latitudes. I can already get the distance and bearing from the initial and final coordinates but now I need to produce the points on the curve to plot through.

What I would like is a formula which takes the origin, destination, and a distance, and returns the latitude/longitude of the point that lies at that distance on the path between the origin and the destination.

I'm currently approximating the earth by a sphere and using radians -- eventually I'll add in spheroid corrections.

j0k
  • 22,600
  • 28
  • 79
  • 90
Nathan
  • 187
  • 1
  • 3
  • 10

1 Answers1

2
currlat = oldlat + d * sin (angle)/ (radius); 
currlon = oldlon + d * cos (angle)/ (radius * cos(oldlat));

where d is distance travelled and angle is in radians. This is assuming circumference of earth at 40000km both at equator and through the poles. You can convert in radians...

Also it assumes the angle (direction) is with reference to equator line.

Obviously this needs spheroid corrections.

if you go south sin values will turn negative and north it will go positive. If you go west cos will turn negative and east it will turn positive.

d * sin(angle) and d * cos(angle) gives you the change. and you just calculate the new lat/long on that basis scaling up against circumference of earth.

Sid Malani
  • 2,078
  • 1
  • 13
  • 13
  • Thank you but the units won't match up here you will have rads+rads/km I assume the sensible route here is to convert distance from rads to km to cancel units? So `currlat=oldlat+(d*sin(angle)*R)/40000` where R is the Earth's radius in km and the 2*Pi is cancelled out by converting the distance travelled from rads to km `d(km)=(d(rads)/2*pi)*R` – Nathan Nov 20 '11 at 19:02
  • I think the problem is with the x axis. So your d * cos (angle) should have been d * cos (angle)/ (radius * cos(oldlat)) – Sid Malani Nov 20 '11 at 22:59
  • Modified the answer above to account for reducing circumference at higher latitudes. At smaller distances this should work ok... – Sid Malani Nov 20 '11 at 23:01
  • hey so this equation `currlat = oldlat + d * sin (angle) * 2 * pi / (circumference_across_poles);` can be similified to `currlat = oldlat + (d * sin (angle)/ (radius of earth));` since the _circumference = 2Pi*R_ with _R=earth radius_ – Nathan Nov 27 '11 at 23:19