internal static double Calculate(double JD, VSOP87Coefficient2[] pTable, int nTableSize, bool bAngle) { double T = (JD - 2451545) / 365250; double TTerm = T; double Result = 0; for (int i = 0; i < nTableSize; i++) { double TempResult = 0; for (int j = 0; j < pTable[i].nCoefficientsSize; j++) { TempResult += pTable[i].pCoefficients[j].A * Math.Cos(pTable[i].pCoefficients[j].B + pTable[i].pCoefficients[j].C * T); } if (i > 0) { TempResult *= TTerm; TTerm *= T; } Result += TempResult; } if (bAngle) { Result = AASCoordinateTransformation.MapTo0To2PIRange(Result); } return(Result); }