tmu-edct-tool / backend

MIT License
6 stars 2 forks source link

Procedure to calculate in-air travel time between two points #5

Open kognise opened 2 years ago

kognise commented 2 years ago

Start with straight-line distance. In the future, better calculations based on route and weather?

kmoberg commented 2 years ago

Formula for calculating distance between two coordinates:

d = ( 3963 * (acos((sin(lat1) * sin (lat2)) + (cos(lat1) * cos(lat2) * cos(lon2 - lon1)))))

Note the coordinates need to be calculated as radians, so in practice use rad(lat1) etc.

To get the time to travel this distance, use formula to get time in minutes:

t = ((d / s) * 60)

This does NOT account for weather, which is a problem. I don't know of a good data source for winds aloft, however, as long as we're using groundspeed to calculate time to waypoint, it shouldn't matter?

kmoberg commented 2 years ago

Also dependent on #13 .