// Solid angle of a body relative to a vessel public static double ComputeBodySolidAngle(Vessel vessel, CelestialBody body) { double dist = FlightGlobals.GetAltitudeAtPos(vessel.position, body) + body.Radius; return(2.0 * Math.PI * (1.0 - Math.cos(dist))); }