Sunlight and air density
A previous post found that the distance sunlight travels through the atmosphere changes more or less linearly through the afternoon, unlike the color of sunlight, meaning a simple distance model is inadequate. We need to factor in air density in the lower atmosphere.
To see how air density might impact the curve, let's divide the amosphere into two halves by height:
Before, we found d + n using a double application of the Pythagorean theorem, and we can do the same to find d, using H/2 instead of H:
When the sun is directly overhead, sunlight travels the same distance through the upper half of the atmosphere as through the lower half, but at sunset, an observer six feet above sea level sees sunlight that has passed 2.4 times further through the lower atmosphere than the upper atmosphere. Since the density of Earth's atmosphere decreases exponentially with height, how much lower atmosphere sunlight passes through makes a big difference in how much air it passes through and can be scattered by, turning it red.
To get a sense of how this ratio changes through as the afternoon, we have to do some more work. We can still find the distance between an observer and the top of the atmosphere using the law of cosines, but to find where the line intersects the middle of the atmosphere, we have to recognize that we know the outer triangle and are looking for a line of specific length from one vertex of the triangle to the opposite edge. Such a line is called a "cevian", and the relationship of its length to the lengths of the triangle's edges is described by Stewart's theorem:
where, referring to the above diagram, a = d + n, b = R + H, c = R + h, and s = R + H/2. We know a and need to solve for m or n. Let's substitute n = a − m and group terms by powers of m:
From here we can use the quadratic equation to solve for m, then substitute in our values for a, b, c, and s.
Let's plot the distance sunlight travels through the upper and lower halves of the atmosphere as the sun moves from directly overhead to the horizon (upper atmosphere in light blue):
While the distance through the lower atmosphere increases faster, the distance through the upper atmosphere levels off.
To plot how this impacts the color of sunlight, we have to combine the distances in a way that weighs the higher density of the lower atmosphere more heavily. Since the density of the atmosphere decreases exponentially with height, we can suppose that the upper half of the atmosphere has a density of e-½ ≈ 0.6 that of the lower atmosphere.
That bends the earlier curve (shown faded) in the right direction, flattening the lower end and suggesting more blue midday light. But the change is slight. The overall curve still suggests a gradual transition of the color of sunlight through the afternoon, rather than a mostly flat curve that spikes near sunset. This is still a simplistic model, with only two layers of atmosphere, so let's do the calculation with ten layers:
That moves the graph the right direction, flatter at the bottom and therefore bluer, but not by much, and running the calculation with 500 layers doesn't push the curve much further. More seems to be going on than either distance or air density fully account for. If you have suggestions, email me.