The math
Observer at height h above a sphere of radius R. The sight line to the horizon is tangent to the surface, so it meets the radius at a right angle.
d² + R² = (R + h)²
d = √(2Rh + h²) ≈ √(2Rh)
On Earth that is d ≈ 3.57 √h km with h in metres.
cos θ = R / (R + h)
s = R·θ dip = θ
θ is the angle at Earth's centre. It is also how far the horizon sits below eye level (dip). s is the distance you would travel over the ground to reach it.
R′ = R / (1 − k), k ≈ 0.13
Refraction bends light around the bulge a little. This is the same as a ~15% larger Earth: d ≈ 3.86 √h km. The 3D view is drawn without refraction, so the ring uses the geometric value.
fraction visible = h / (2(R + h))
Seeing a peak of height H: dmax = √(2Rh) + √(2RH).
Engine: CesiumJS (Apache-2.0). Imagery: Sentinel-2 cloudless by EOX (contains modified Copernicus Sentinel data) or © OpenStreetMap contributors. Terrain: AWS Terrain Tiles. Live flight data: Flightradar24 API (your own key).