Physics Stack Exchange is a question and answer site for active researchers, academics and students of physics. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been asked to find a way to calculate the amount of time that a flight takes during night time.

So far, I have the departure latitude and longitude and the time of takeoff, the arrival latitude and longitude and the time of landing. I can easily calculate the sunset and sunrise time at the departure location, and at the arrival location. But I don't know how to proceed in order to find at which moment of the flight the sunrise and sunset will happen at the location where the aircraft is at that precise moment.

I'm just asking for some guidance on how to resolve this problem.

PS: The calculation does not have to be very precise, and estimation is more than enough. We are just looking for the simplest solution to obtain an acceptable result.

share|cite|improve this question
There can be no exact solution without knowing the speed as a function of the time, and the exact route of the flight. If the plane goes very fast in the beginning and slow later, or the other way around, it will move the moment you hit sunset (or sunrise), so the time you want depends on it. – Aganju Jan 5 at 17:38

One option would be to plot the course of the flight as a set of discrete points and check if it's day or night at each point along the way to determine when the flight enters/exits the Earths shadow. Precision will be limited to the size of your time increment, but doing a once/minute check on a computer shouldn't be a problem.

For a high precision result you'd need to program in actual flight corridors; but for a rough estimate assuming the shortest direct route will probably be good enough in most cases.

share|cite|improve this answer

The answer to this question involves quite a bit of spherical trigonometry. Call $(\lambda_1,\varphi_1)$ the longitude and latitude of the place of departure, and $(\lambda_2,\varphi_2)$ the coordinates of the destination. Let's assume that the plane travels along a great circle. Then it will travel a total angle $\theta$, given by $$ \cos\theta = \sin\varphi_1\sin\varphi_2 + \cos\varphi_1\cos\varphi_2\cos(\lambda_2-\lambda_1). $$ If $\theta$ is expressed it radians, then the corresponding distance is $D=\theta R_\oplus$, with $R_\oplus$ the radius of the Earth. Suppose that the total flight time is $T$, and that the plane flies at a constant speed. If $t$ is the time since take-off, then $$ \begin{align} \theta_1 &= \theta t/T,\\ \theta_2 &= \theta -\theta_1, \end{align} $$ where $\theta_1$ is the angle traveled by the plane at time $t$, while $\theta_2$ is the angle that the plane still has to travel. At time $t$, the plane will then be above the location $(\lambda,\varphi)$, given by $$ \begin{align} \cos\theta_1 &= \sin\varphi_1\sin\varphi + \cos\varphi_1\cos\varphi\cos(\lambda-\lambda_1),\\ \cos\theta_2 &= \sin\varphi_2\sin\varphi + \cos\varphi_2\cos\varphi\cos(\lambda-\lambda_2), \end{align} $$ from which $(\lambda(t),\varphi(t))$ can be derived (after some tedius calculations).

If we know the Greenwhich Mean Solar Time $t_0$ at the moment of departure, then we can obtain the hour angle $H_\odot(t)$ of the Sun at $(\lambda(t),\varphi(t))$: $$ H_\odot(t) + 12^\text{h}=t_0 +t + \lambda(t)\qquad\text{(modulo $24^\text{h}$)}, $$ where all variables are expressed in hours, minutes, and seconds (and $360^\circ$ corresponds with $24^\text{h}$). We also need to know the declination of the Sun $\delta_\odot$ during the flight (so we need to know the date).

The altitude of the Sun $a_\odot(t)$ above the local horizon is then $$ \sin a_\odot(t) = \sin\varphi(t)\sin\delta_\odot + \cos\varphi(t)\cos\delta_\odot \cos H_\odot(t) $$ (see the wiki page on celestial coordinates). Sunset and sunrise correspond with $a_\odot=0^\circ$ on the ground (ignoring atmospheric refraction). Using simple trigonometry, it is easy to show that from the plane's perspective, at a height $h$, sunset and sunrise will occur when $$a_\odot= -\cos^{-1}(R_\oplus/(R_\oplus+h)).$$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.