/// <summary>
/// 月球经度计算
/// </summary>
/// <param name="t">世纪数</param>
/// <param name="n">项数比例</param>
/// <returns>Date分点黄经</returns>
public static double MLon(double t, int n)
{
var ob = XL1;
var obl = ob[0].Length;
double tn = 1;
double v = 0;
double t2 = t * t,
t3 = t2 * t,
t4 = t3 * t,
t5 = t4 * t,
tx = t - 10;
v += (3.81034409 + 8399.684730072 * t - 3.319e-05 * t2 + 3.11e-08 * t3 - 2.033e-10 * t4) * SECOND_PER_RAD;
v += 5028.792262 * t + 1.1124406 * t2 + 0.00007699 * t3 - 0.000023479 * t4 - 0.0000000178 * t5;
if (tx > 0)
{
v += -0.866 + 1.43 * tx + 0.054 * tx * tx;
}
t2 /= 1e4;
t3 /= 1e8;
t4 /= 1e8;
n *= 6;
if (n < 0)
{
n = obl;
}
for (int i = 0, x = ob.Length; i < x; i++, tn *= t)
{
var f = ob;
var l = f.Length;
var m = (int)(n * l * 1D / obl + 0.5);
if (i > 0)
{
m += 6;
}
if (m >= l)
{
m = l;
}
int j;
double c;
for (j = 0, c = 0; j < m; j += 6)
{
c += f[j] * Math.Cos(f[j + 1] + t * f[j + 2] + t2 * f[j + 3] + t3 * f[j + 4] + t4 * f[j + 5]);
}
v += c * tn;
}
v /= SECOND_PER_RAD;
return v;
}