Example #1
0
        public static double CorrectEquinox(double JDE, EquinoxType Equinox)
        {
            Earth  earth = new Earth();
            double L = earth.CalculateHelocentricLongitude(JDE, 5);
            double B = earth.CalculateHelocentricLatitude(JDE, 4);
            double R = earth.CalculateRadiusVector(JDE, 5);
            double dL, dB, aberration, nutation;

            earth.CorrectLB(L, B, JDE, out dL, out dB);
            aberration = -(20.4898 / R);
            nutation   = MathHelper.Rev(earth.CalculateNutation(JDE));
            double ApparentGeocentricLongitude;

            ApparentGeocentricLongitude = L - 180 - (nutation / 3600) + (dL / 3600) + (aberration / 3600);
            double correction = 58 * MathHelper.Sin((int)Equinox * 90 - ApparentGeocentricLongitude);
            double JDE0       = JDE + correction;

            if (correction <= 0.0000005 && correction >= -0.0000005)
            {
                return(Math.Round(JDE0, 5));;
            }
            else
            {
                return(CorrectEquinox(JDE0, Equinox));
            }
        }