Exemple #1
0
        /// <summary>
        ///计算航天器是否在太阳光照中。1 为是, 0 为否。 可用于计算太阳光压。
        /// Computes the fractional illumination of a spacecraft in the
        ///   vicinity of the Earth assuming a cylindrical shadow model
        /// </summary>
        /// <param name="satXyz_m">Spacecraft position vector [m]</param>
        /// <param name="sunXyz_m">   Sun position vector [m]</param>
        /// <returns>  Illumination factor:
        ///                     nu=0   Spacecraft in Earth shadow
        ///                     nu=1   Spacecraft fully illuminated by the Sun</returns>
        public static double Illumination(Geo.Algorithm.Vector satXyz_m, Geo.Algorithm.Vector sunXyz_m)
        {
            Geo.Algorithm.Vector e_Sun = sunXyz_m.DirectionUnit(); // Sun direction unit vector
            double s = satXyz_m.Dot(e_Sun);                        // Projection of s/c position

            return((s > 0 || (satXyz_m - s * e_Sun).Norm() > OrbitConsts.RadiusOfEarth) ? 1.0 : 0.0);
        }