<p>After choosing an arbitrary time t, you have the two equations you reference and two unknowns: $ λ$ and $φ$. The problem is that the equations cannot be solved directly, so an iterative approach is required. For example, </p>

<ul>
<li>assume that $(λ−λ_1)=θ_1$. Note that this also lets you calculate $λ$</li>
<li>solve for $φ$ from the first equation</li>
<li>use that value of $φ$ in the second equation to solve for $λ$</li>
<li>If the values of $λ$ from equation 1 and 2 are different, try another value for $λ$ in the first equation.</li>
<li>repeat until the assumed value for $λ$ in equation 1 and the calculated value from equation 2 are equal.</li>
</ul>

<p>It has been a long time since I did spherical trig, but I think the solution on the Physics SE is inefficient. It looks like they are calculating the sun's altitude at multiple point (multiple times of t) along the path, so the two equations two unknowns needs to be solved multiple times -- that is inefficient. It should be possible to determine the equation of the great circle through the departure and destination point. Essentially you need to calculate the longitude of where it cross the equator and the inclination. That probably needs to be solved iteratively, but it only needs to be solved once. Then for any time t, the position $λ$ and $φ$ can be calculated directly, and the sun's altitude can be calculated directly. </p>

CC BY-SA 3.0
2017-08-31T16:35:23.957Z
2017-08-31T16:35:23.957Z
JohnHoltz
<p>I found an answer at 
<a href="https://physics.stackexchange.com/questions/26795/how-to-calculate-the-amount-of-night-time-during-a-flight">https://physics.stackexchange.com/questions/26795/how-to-calculate-the-amount-of-night-time-during-a-flight</a></p>

<p>but I was stuck at the part:</p>

<p>$\cosθ_1=\sinφ_1\sinφ+\cosφ_1\cosφ\cos(λ−λ_1)$</p>

<p>$\cosθ_2=\sinφ_2\sinφ+\cosφ_2\cosφ\cos(λ−λ_2)$</p>

<p>from which  $ (λ(t),φ(t))$</p>

<p>can be derived (after some tedious calculations).</p>

CC BY-SA 3.0
2017-08-30T01:45:31.243Z
This might be more suitable for [Aviation SE](https://aviation.stackexchange.com/).
StephenG - Help Ukraine
<astrophysics><mathematics>
calculate sunset in flight
user3556225
# calculate sunset in flight

(Asked by: username_0 on 2017-08-29)

I found an answer at
<https://physics.stackexchange.com/questions/26795/how-to-calculate-the-amount-of-night-time-during-a-flight>

but I was stuck at the part:

$\cosθ\_1=\sinφ\_1\sinφ+\cosφ\_1\cosφ\cos(λ−λ\_1)$

$\cosθ\_2=\sinφ\_2\sinφ+\cosφ\_2\cosφ\cos(λ−λ\_2)$

from which $ (λ(t),φ(t))$

can be derived (after some tedious calculations).

**Tags:** astrophysics, mathematics

> **Comments:**
> **username_1**: This might be more suitable for [Aviation SE](https://aviation.stackexchange.com/).  

---

## 1 answers

### Answer by username_2 on 2017-08-31. Score: 1

After choosing an arbitrary time t, you have the two equations you reference and two unknowns: $ λ$ and $φ$. The problem is that the equations cannot be solved directly, so an iterative approach is required. For example,

* assume that $(λ−λ\_1)=θ\_1$. Note that this also lets you calculate $λ$
* solve for $φ$ from the first equation
* use that value of $φ$ in the second equation to solve for $λ$
* If the values of $λ$ from equation 1 and 2 are different, try another value for $λ$ in the first equation.
* repeat until the assumed value for $λ$ in equation 1 and the calculated value from equation 2 are equal.

It has been a long time since I did spherical trig, but I think the solution on the Physics SE is inefficient. It looks like they are calculating the sun's altitude at multiple point (multiple times of t) along the path, so the two equations two unknowns needs to be solved multiple times -- that is inefficient. It should be possible to determine the equation of the great circle through the departure and destination point. Essentially you need to calculate the longitude of where it cross the equator and the inclination. That probably needs to be solved iteratively, but it only needs to be solved once. Then for any time t, the position $λ$ and $φ$ can be calculated directly, and the sun's altitude can be calculated directly.


---

