示例#1
0
        public static void CalcMoonPos(DateTime dDate, DateTime dEpoch, double fMEpochLong, double fMPeriLong, double fMAscNode, double fMIncl, double fMEcc, double fSEpochEclLong, double fSPeriEclLong, double fSEcc, ref double fMRA, ref double fMDecl)
        {
            double fN, fSM, fSE, fSLambda;
            double fL, fMM, fMN, fME, fAE, fMEC, fA3, fA4, fMV, fMM1, fL1, fL2, fN1, fX, fY;
            double fT, fMLambda, fMBeta, fJD1, fJD2, fDays;

            fJD1   = GetJulianDay(dDate, 0);
            fJD2   = GetJulianDay(dEpoch, 0);
            fDays  = (fJD1 - fJD2);
            fDays += 1;

            fN  = (360.0 / 365.242191) * fDays;
            fN  = Trig.PutIn360Deg(fN);
            fSM = fN + fSEpochEclLong - fSPeriEclLong;
            fSM = Trig.PutIn360Deg(fSM);

            fSE      = (360.0 / Math.PI) * fSEcc * Math.Sin(Trig.DegToRad(fSM));
            fSLambda = fN + fSE + fSEpochEclLong;

            fL = (13.176396 * fDays) + fMEpochLong;
            fL = Trig.PutIn360Deg(fL);

            fMM = fL - (0.111404 * fDays) - fMPeriLong;
            fMM = Trig.PutIn360Deg(fMM);

            fMN = fMAscNode - (0.0529539 * fDays);
            fMN = Trig.PutIn360Deg(fMN);

            fME = 1.2739 * Trig.Sin((2.0 * (fL - fSLambda)) - fMM);
            fAE = 0.1858 * Trig.Sin(fSM);
            fA3 = 0.37 * Trig.Sin(fSM);

            fMM1 = fMM + fME - fAE + fA3;

            fMEC = 6.2886 * Trig.Sin(fMM1);
            fA4  = 0.214 * Trig.Sin(2.0 * fMM1);
            fL1  = fL + fME + fMEC - fAE + fA4;

            fMV = 0.6583 * Trig.Sin(2.0 * (fL1 - fSLambda));
            fL2 = fL1 + fMV;

            fN1 = fMN - (0.16 * Trig.Sin(fSM));
            fY  = Trig.Sin(fL2 - fN1) * Trig.Cos(fMIncl);
            fX  = Trig.Cos(fL2 - fN1);

            fT = Trig.Atan(fY / fX);

            fT = Trig.TanQuadrant(fX, fY, fT);

            fMLambda = fT + fN1;
            fMBeta   = Trig.Asin(Trig.Sin(fL2 - fN1) * Trig.Sin(fMIncl));
            ConvEclToEqu(23.441884, fMLambda, fMBeta, ref fMRA, ref fMDecl);
        }
示例#2
0
        public static double CalcMoonBrightLimb(double fSunRA, double fSunDecl, double fMRA, double fMDecl)
        {
            double fX, fY, fT, fDeltaRA;

            fSunRA   = fSunRA * 15;
            fMRA     = fMRA * 15;
            fDeltaRA = fSunRA - fMRA;

            fY = Trig.Cos(fSunDecl) * Trig.Sin(fDeltaRA);
            fX = (Trig.Cos(fMDecl) * Trig.Sin(fSunDecl)) - (Trig.Sin(fMDecl) * Trig.Cos(fSunDecl) * Trig.Cos(fDeltaRA));
            fT = Trig.Atan(fY / fX);
            return(Trig.TanQuadrant(fX, fY, fT));
        }
示例#3
0
        public static void ConvEclToEqu(double fOblique, double fELong, double fELat, ref double fRA, ref double fDecl)
        {
            double fX;
            double fY;
            double fSinDecl;

            fELong   = Trig.DegToRad(fELong);
            fELat    = Trig.DegToRad(fELat);
            fOblique = Trig.DegToRad(fOblique);
            fSinDecl = (Math.Sin(fELat) * Math.Cos(fOblique)) + (Math.Cos(fELat) * Math.Sin(fOblique) * Math.Sin(fELong));
            fDecl    = Math.Asin(fSinDecl);
            fY       = (Math.Sin(fELong) * Math.Cos(fOblique)) - (Math.Tan(fELat) * Math.Sin(fOblique));
            fX       = Math.Cos(fELong);
            fRA      = Math.Atan(fY / fX);
            fRA      = Trig.RadToDeg(fRA);
            fDecl    = Trig.RadToDeg(fDecl);
            fRA      = Trig.TanQuadrant(fX, fY, fRA);
            fRA      = fRA / 15.0;
        }