Features in Educational
Linear interpolation for refraction correction.
We use a lookup table to determine the correction due to atmospheric refraction for an object's apparent altitude as a function of its true altitude. Until now, we adopted the correction value from the nearest altitude position in the lookup table. This breaks down near the horizon because the correction changes rapidly with altitude, resulting in large discontinuous "jumps" as an object's altitude carries it between positions in the lookup table.
Now, we are using linear inerpolation to ensure that the refraction correction is a smooth function of the true altitude.
TODO: doing linear interpolation is more costly than a straight table lookup. It might make sense to only interpolate near the horizon, where the corrections are large and changing rapidly with altitude.
The straight-lookup strategy should be fine above some threshhold altitude.