René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback -
 

Calculating the visible distance (to the horizon)

The distance (D) is the radius (r) multiplied by the angle (alpha) between two points.
D = r * alpha
alpha is:
alpha = asin( sqrt( 2*h*r + h*h) / (r+h) )
The radius is 6371 km:
r = 6371 km
Altitude: meters
Radius: kilometers

Visible distance: kilometers