Exemplo n.º 1
0
        public void calculateCoordinatesMethodM(double julian)
        {
            double DG  = GPMath.rads;
            double RAD = 180 / GPMath.pi;

            double t  = (julian - 2451545.0) / 36525;
            double t2 = t * t;
            double t3 = t2 * t;
            double t4 = t2 * t2;

            // mean ecliptic longitude of the sun
            double L0 = 280.4664567 + 36000.76982779 * t + 0.0003032028 * t2 + t3 / 49931000;

            // mean anomaly of the sun
            double M = 357.5291 + 35999.05030 * t - 0.0001559 * t2 - 0.00000048 * t3;

            L0             = GPMath.putIn360(L0);
            M              = GPMath.putIn360(M);
            sunMeanAnomaly = M;

            double C = (1.9146 - 0.004817 * t - 0.000014 * t2) * GPMath.sinDeg(M)
                       + (0.019993 - 0.000101 * t) * GPMath.sinDeg(2 * M)
                       + 0.00029 * GPMath.sinDeg(3 * M);

            sunEquationCenter = C;

            // ecliptic longitude of the sun
            //double els = 0;
            eclipticalLongitude = GPMath.putIn360(L0 + C);

            double e           = 0.016708617 - 0.000042037 * t - 0.0000001236 * t2;
            double trueAnomaly = M + C;


//            double epsilon;
//            double deltaPhi;

//            GPAstroEngine.calc_epsilon_phi(julianDay, out deltaPhi, out epsilon);
//            = 23.4391 - 0.013 * t - t2/6101694;
            double omega    = 125.04 - 1934.136 * t;
            double lambda   = eclipticalLongitude - 0.00569 - 0.00478 * GPMath.sinDeg(omega);
            double epsilon0 = 23.4392911 - 0.01300416 * t - 1.638e-7 * t2;
            double epsilon1 = epsilon0 + 0.00256 * GPMath.cosDeg(omega);

            // right ascension of the sun
            this.rightAscession = RAD * Math.Atan2(GPMath.cosDeg(epsilon1) * GPMath.sinDeg(lambda), GPMath.cosDeg(lambda));
            this.rightAscession = GPMath.putIn360(rightAscession);

            // declination of the sun
            this.declination = GPMath.arcsinDeg(GPMath.sinDeg(epsilon1) * GPMath.sinDeg(lambda));

            // equation of time
            equationOfTime = GPAstroEngine.getEquationOfTime(julian, this.rightAscession);
        }