I am currently working on a project (web app) at university to be able to calculate the amount of time spent during night flying. Currently, I have,
Departure Lat and Long and Departure Time in UTC
Arrival Lat and Long and Arrival Time in UTC Sunset and
Sunrise Times (Based on dates) for both Arrival and Departure airfields in UTC
Depart UK Edingburgh airport on the 23 April 2019 at 11:10 UTC
Arrive Riyadh Airport at 18:10 UTC Total Time 7hr
day flight = ?
night flight = ?
I know many places online do this type of calculation for you, so I am wondering if there is a formula or method available that allows me to do this calculation (Which I can then convert to code)?