コード例 #1
0
        private static (double longitude, double obliquity) swi_nutation(JulianDayNumber tjd, SweData swed)
        {
            // from interpolation, with three data points in 1-day steps;
            // maximum error is about 3 mas
            if (swed.InterpolateNutation)
            {
                // precalculated data points available
                if (swed.InterpolatedNutation != null && tjd < swed.InterpolatedNutation.Time2 && tjd > swed.InterpolatedNutation.Time0)
                {
                    var dx        = (tjd - swed.InterpolatedNutation.Time0).Raw - 1.0;
                    var longitude = quadratic_intp(swed.InterpolatedNutation.DPsi0, swed.InterpolatedNutation.DPsi1, swed.InterpolatedNutation.DPsi2, dx);
                    var obliquity = quadratic_intp(swed.InterpolatedNutation.DEps0, swed.InterpolatedNutation.DEps1, swed.InterpolatedNutation.DEps2, dx);
                    return(longitude, obliquity);
                }
                else
                {
                    var interpol = new InterpolatedNutation
                    {
                        Time0 = tjd.AddDays(-1.0),                       // one day earlier
                        Time2 = tjd.AddDays(1.0)                         // one day later
                    };

                    (interpol.DPsi0, interpol.DEps0) = calc_nutation(interpol.Time0, swed);
                    (interpol.DPsi2, interpol.DEps2) = calc_nutation(interpol.Time2, swed);
                    (interpol.DPsi1, interpol.DEps1) = calc_nutation(tjd, swed);

                    swed.InterpolatedNutation = interpol;
                    return(interpol.DPsi1, interpol.DEps1);
                }
            }
            return(calc_nutation(tjd, swed));
        }
コード例 #2
0
 internal static Nutation CalculateForSpeed(JulianDayNumber tjd, SweData swed) =>
 Calculate(tjd.AddDays(-NUT_SPEED_INTV), swed);