" . SqRt($D*$D  $R*$R) . "
";
$S = "Surface Distance to Horizon (S) = " . $R * (M_PI/2  (aCos(SqRt($D*$D  $R*$R) / $D))) . "
";
$out = $H . "" . SqRt(($R + $D)*($R + $D)  $R*$R) . "
";
$S = "Surface Distance to Horizon (S) = " . $R * (M_PI/2  (aCos(SqRt(2 * $R * $D + $D*$D) / ($R + $D)))) . "
";
$out = $H . "
Distance From Eye to Horizon of a SphereThis program computes the lineofsight distance to the horizon of a sphere at any distance from (height of) the eye as reckoned from the surface or center of the sphere. The radius and distance can be in any convenient linear units. The initial default values are the mean lunar radius and distance of the eye above the surface, both in kilometers.$out Where the Distance to the Eye Is Reckoned From the Surface of the Sphere: Given the radius ( R ) of the sphere and the distance (d ) (height of) of the eye above the surface of the sphere, the general equation for the lineofsight distance (H ) to the sphere horizon viewed from that point is:The horizon distance (
S ), corresponding to (H ), but measured along the curved surface of the sphere, corresponding to the sailing distance is:Where: R > 0 and d > 0 and angles are in degrees Where the Distance to the Eye Is Reckoned From the Center of the Sphere:
Given the radius ( R ) of the sphere and the distance (D ) of the eye from the center of the sphere, the general equation for the lineofsight distance (H ) to the sphere horizon viewed from that point is:
The horizon distance ( S ), corresponding to (H ), but measured along the curved surface of the sphere, corresponding to the sailing distance is:Where: D > R and R > 0 and angles are in degrees © Jay Tanner  PHP Science Labs $cYear  $_PROGRAM_VERSION_
_HTML;
// Generate end of HTML page
print <<< _HTML
_HTML;
?>
