Ejemplo n.º 1
0
        private static double getCorrection(double D, double a1, double a2, double a3, double d1, double d2, double d3, double siderealTime, double h0, double longitude, double latitude, double m0, bool transit)
        {
            double deltaM = 0;
            double PHI    = siderealTime + 360.985647 * m0;
            double n      = m0 + GPDynamicTime.GetDeltaT(D) / 86400;

            double alpha = GPAstroEngine.interpolation(a1, a2, a3, n);
            double delta = GPAstroEngine.interpolation(d1, d2, d3, n);

            double H = GPMath.putIn180(PHI - longitude - alpha);
            double h = 0;

            if (transit)
            {
                deltaM = -H / 360;
            }
            else
            {
                double sinH = GPMath.sinDeg(latitude) * GPMath.sinDeg(delta) + GPMath.cosDeg(latitude) * GPMath.cosDeg(delta) * GPMath.cosDeg(H);
                h      = GPMath.arcsinDeg(sinH);
                deltaM = (h - h0) / (360 * GPMath.cosDeg(delta) * GPMath.cosDeg(latitude) * GPMath.sinDeg(H));
            }
            return(deltaM);
        }