/// <summary> /// Gets Besselian elements values for specified Juluan Day. /// </summary> /// <param name="jd">Julian Day of interest</param> /// <returns></returns> internal InstantBesselianElements GetInstantBesselianElements(double jd) { //if (jd < From || jd > To) // throw new ArgumentException($"Polynomial Besselian elements valid only for Julian Day in range [{From} ... {To}].", nameof(jd)); // difference, with t0, in step units double t = (jd - JulianDay0) / Step; return(new InstantBesselianElements() { X = X.Select((x, n) => x * Pow(t, n)).Sum(), Y = Y.Select((y, n) => y * Pow(t, n)).Sum(), L1 = L1.Select((l1, n) => l1 * Pow(t, n)).Sum(), L2 = L2.Select((l2, n) => l2 * Pow(t, n)).Sum(), D = D.Select((d, n) => d * Pow(t, n)).Sum(), Mu = To360(Mu.Select((mu, n) => mu * Pow(t, n)).Sum()), F1 = F1.Select((f1, n) => f1 * Pow(t, n)).Sum(), F2 = F2.Select((f2, n) => f2 * Pow(t, n)).Sum(), dX = Derivative(X, t), dY = Derivative(Y, t), dL1 = Derivative(L1, t), dL2 = Derivative(L2, t), dD = Derivative(D, t), dMu = Derivative(Mu, t) }); }