示例#1
0
        /// <summary>
        /// Takes a local DateTime-struct and returns the Moon's right ascension (RAd), declination (DECLd) and Angular Diameter (AngDiam) in degrees as a MoonStruct.
        /// </summary>
        /// <param name="DT"></param>
        /// <returns></returns>
        public static Structs.Moon MoonTG(Structs.MyDateTime DT, Structs.MyLoc Loc)
        {
            double GDay   = Time.LDTtoGCDay(DT.LocHour, DT.LocMin, DT.LocSec, DT.DS, DT.ZC, DT.LocDay, DT.LocMonth, DT.LocYear);
            double GMonth = Time.LDTtoGCMonth(DT.LocHour, DT.LocMin, DT.LocSec, DT.DS, DT.ZC, DT.LocDay, DT.LocMonth, DT.LocYear);
            double GYear  = Time.LDTtoGCYear(DT.LocHour, DT.LocMin, DT.LocSec, DT.DS, DT.ZC, DT.LocDay, DT.LocMonth, DT.LocYear);
            double UT     = Time.LDTtoUT(DT.LocHour, DT.LocMin, DT.LocSec, DT.DS, DT.ZC, DT.LocDay, DT.LocMonth, DT.LocYear);
            double MLon   = Subs.MoonLong(DT.LocHour, DT.LocMin, DT.LocSec, DT.DS, DT.ZC, DT.LocDay, DT.LocMonth, DT.LocYear);
            double MLat   = Subs.MoonLat(DT.LocHour, DT.LocMin, DT.LocSec, DT.DS, DT.ZC, DT.LocDay, DT.LocMonth, DT.LocYear);
            double NaL    = Subs.NutLong(GDay, GMonth, GYear);
            double CorLon = MLon + NaL;
            double HP     = Subs.MoonHorPar(DT.LocHour, DT.LocMin, DT.LocSec, DT.DS, DT.ZC, DT.LocDay, DT.LocMonth, DT.LocYear);
            double EMdist = 6378.14d / Helpers.Sin(Helpers.toRadians(HP));
            double MS     = Subs.MoonSize(DT.LocHour, DT.LocMin, DT.LocSec, DT.DS, DT.ZC, DT.LocDay, DT.LocMonth, DT.LocYear);
            double Mra    = Subs.EclCoo_RA(CorLon, 0, 0, MLat, 0, 0, GDay, GMonth, GYear);
            double Mdec   = Subs.EclCoo_Dec(CorLon, 0, 0, MLat, 0, 0, GDay, GMonth, GYear);

            double Lon = Loc.Lon;
            double Lat = Loc.Lat;
            double h   = Loc.h;

            double LCT    = Time.UTLct(UT, 0, 0, DT.DS, DT.ZC, GDay, GMonth, GYear);
            double HA     = Subs.RAHA((Mra / 15), 0, 0, LCT, 0, 0, DT.DS, DT.ZC, DT.LocDay, DT.LocMonth, DT.LocYear, Lon);
            double CorHA  = Subs.ParallaxHA(HA, 0, 0, Mdec, 0, 0, true, Lat, h, HP);
            double CorRA  = Subs.HARA(CorHA, 0, 0, LCT, 0, 0, DT.DS, DT.ZC, DT.LocDay, DT.LocMonth, DT.LocYear, Lon);
            double CorDec = Subs.ParallaxDec(HA, 0, 0, Mdec, 0, 0, true, Lat, h, HP);

            Structs.Moon result = new Structs.Moon(Mra, Mdec, CorRA, CorDec, MS);

            return(result);
        }