Esempio n. 1
0
        /// <summary>
        /// Calculates Besselian elements for lunar eclipse,
        /// valid only for specified instant.
        /// </summary>
        /// <param name="position">Sun and Moon position data</param>
        /// <returns>
        /// Besselian elements for lunar eclipse
        /// </returns>
        /// <remarks>
        /// The method is based on formulae given here:
        /// https://de.wikipedia.org/wiki/Besselsche_Elemente
        /// </remarks>
        internal static InstantLunarEclipseElements BesselianElements(SunMoonPosition position)
        {
            // Geocentric RA of the center of Earth shadow
            double a = ToRadians(position.Sun.Alpha + 180);

            // Geocentric Dec of the center of Earth shadow
            double d = ToRadians(-position.Sun.Delta);

            // Geocentric RA of the Moon, in radians
            double am = ToRadians(position.Moon.Alpha);

            // Geocentric Dec of the Moon, in radians
            double dm = ToRadians(position.Moon.Delta);

            double x = Cos(dm) * Sin(am - a);
            double y = Sin(dm) * Cos(d) - Cos(dm) * Sin(d) * Cos(am - a);

            // Astronomical unit, in km
            const double AU = 149597870;

            // Earth radius, in km
            const double EARTH_RADIUS = 6371;

            // Seconds in degree
            const double SEC_IN_DEGREE = 3600;

            // Geocentric solar radius, in degrees
            double rs = SolarEphem.Semidiameter(position.DistanceSun * EARTH_RADIUS / AU) / SEC_IN_DEGREE;

            // Geocentric lunar radius, in degrees
            double rm = LunarEphem.Semidiameter(position.DistanceMoon * EARTH_RADIUS) / SEC_IN_DEGREE;

            // Geocentric parallax of the Sun, in degrees
            double pi_s = LunarEphem.Parallax(position.DistanceSun * EARTH_RADIUS);

            // Geocentric parallax of the Moon, in degrees
            double pi_m = LunarEphem.Parallax(position.DistanceMoon * EARTH_RADIUS);

            // Danjon rule of shadow enlargement is used
            const double ENLARGEMENT = 1.01;

            // Earth penumbra radius, in degrees
            double f1 = ENLARGEMENT * pi_m + pi_s + rs;

            // Earth umbra radius, in degrees
            double f2 = ENLARGEMENT * pi_m + pi_s - rs;

            // Lunar radius (semidiameter), in degrees
            double f3 = rm;

            return(new InstantLunarEclipseElements()
            {
                JulianDay = position.JulianDay,
                // Convert to degrees:
                // http://www.eclipsewise.com/lunar/LEprime/2001-2100/LE2021May26Tprime.html
                X = ToDegrees(x),
                Y = ToDegrees(y),
                F1 = f1,
                F2 = f2,
                F3 = f3,
                Alpha = position.Moon.Alpha,
                Delta = position.Moon.Delta
            });
        }
Esempio n. 2
0
 /// <summary>
 /// Gets visible semidiameter of the Moon, in seconds of arc
 /// </summary>
 public double Semidiameter(SkyContext c)
 {
     return(LunarEphem.Semidiameter(c.Get(Ecliptical0).Distance));
 }