Frage

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.

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top