public void BTest(double jd, double expectedResult)
        {
            double result = AASVSOP87D_Jupiter.B(jd);

            Assert.Equal(expectedResult, result);
        }
Ejemplo n.º 2
0
        public static double EclipticLatitude(double JD, bool bHighPrecision)
        {
            if (bHighPrecision)
            {
                return(AASCoordinateTransformation.MapToMinus90To90Range(AASCoordinateTransformation.RadiansToDegrees(AASVSOP87D_Jupiter.B(JD))));
            }

            double rho        = (JD - 2451545) / 365250;
            double rhosquared = rho * rho;
            double rhocubed   = rhosquared * rho;
            double rho4       = rhocubed * rho;
            double rho5       = rho4 * rho;

            //Calculate B0
            int    nB0Coefficients = g_B0JupiterCoefficients.Length;
            double B0 = 0;
            int    i;

            for (i = 0; i < nB0Coefficients; i++)
            {
                B0 += g_B0JupiterCoefficients[i].A * Math.Cos(g_B0JupiterCoefficients[i].B + g_B0JupiterCoefficients[i].C * rho);
            }

            //Calculate B1
            int    nB1Coefficients = g_B1JupiterCoefficients.Length;
            double B1 = 0;

            for (i = 0; i < nB1Coefficients; i++)
            {
                B1 += g_B1JupiterCoefficients[i].A * Math.Cos(g_B1JupiterCoefficients[i].B + g_B1JupiterCoefficients[i].C * rho);
            }

            //Calculate B2
            int    nB2Coefficients = g_B2JupiterCoefficients.Length;
            double B2 = 0;

            for (i = 0; i < nB2Coefficients; i++)
            {
                B2 += g_B2JupiterCoefficients[i].A * Math.Cos(g_B2JupiterCoefficients[i].B + g_B2JupiterCoefficients[i].C * rho);
            }

            //Calculate B3
            int    nB3Coefficients = g_B3JupiterCoefficients.Length;
            double B3 = 0;

            for (i = 0; i < nB3Coefficients; i++)
            {
                B3 += g_B3JupiterCoefficients[i].A * Math.Cos(g_B3JupiterCoefficients[i].B + g_B3JupiterCoefficients[i].C * rho);
            }

            //Calculate B4
            int    nB4Coefficients = g_B4JupiterCoefficients.Length;
            double B4 = 0;

            for (i = 0; i < nB4Coefficients; i++)
            {
                B4 += g_B4JupiterCoefficients[i].A * Math.Cos(g_B4JupiterCoefficients[i].B + g_B4JupiterCoefficients[i].C * rho);
            }

            //Calculate B5
            int    nB5Coefficients = g_B5JupiterCoefficients.Length;
            double B5 = 0;

            for (i = 0; i < nB5Coefficients; i++)
            {
                B5 += g_B5JupiterCoefficients[i].A * Math.Cos(g_B5JupiterCoefficients[i].B + g_B5JupiterCoefficients[i].C * rho);
            }

            double value = (B0 + B1 * rho + B2 * rhosquared + B3 * rhocubed + B4 * rho4 + B5 * rho5) / 100000000;

            //convert results back to degrees
            value = AASCoordinateTransformation.RadiansToDegrees(value);
            return(value);
        }
Ejemplo n.º 3
0
        public static double RadiusVector(double JD, bool bHighPrecision)
        {
            if (bHighPrecision)
            {
                return(AASVSOP87D_Jupiter.R(JD));
            }

            double rho        = (JD - 2451545) / 365250;
            double rhosquared = rho * rho;
            double rhocubed   = rhosquared * rho;
            double rho4       = rhocubed * rho;
            double rho5       = rho4 * rho;

            //Calculate R0
            int    nR0Coefficients = g_R0JupiterCoefficients.Length;
            double R0 = 0;
            int    i;

            for (i = 0; i < nR0Coefficients; i++)
            {
                R0 += g_R0JupiterCoefficients[i].A * Math.Cos(g_R0JupiterCoefficients[i].B + g_R0JupiterCoefficients[i].C * rho);
            }

            //Calculate R1
            int    nR1Coefficients = g_R1JupiterCoefficients.Length;
            double R1 = 0;

            for (i = 0; i < nR1Coefficients; i++)
            {
                R1 += g_R1JupiterCoefficients[i].A * Math.Cos(g_R1JupiterCoefficients[i].B + g_R1JupiterCoefficients[i].C * rho);
            }

            //Calculate R2
            int    nR2Coefficients = g_R2JupiterCoefficients.Length;
            double R2 = 0;

            for (i = 0; i < nR2Coefficients; i++)
            {
                R2 += g_R2JupiterCoefficients[i].A * Math.Cos(g_R2JupiterCoefficients[i].B + g_R2JupiterCoefficients[i].C * rho);
            }

            //Calculate R3
            int    nR3Coefficients = g_R3JupiterCoefficients.Length;
            double R3 = 0;

            for (i = 0; i < nR3Coefficients; i++)
            {
                R3 += g_R3JupiterCoefficients[i].A * Math.Cos(g_R3JupiterCoefficients[i].B + g_R3JupiterCoefficients[i].C * rho);
            }

            //Calculate R4
            int    nR4Coefficients = g_R4JupiterCoefficients.Length;
            double R4 = 0;

            for (i = 0; i < nR4Coefficients; i++)
            {
                R4 += g_R4JupiterCoefficients[i].A * Math.Cos(g_R4JupiterCoefficients[i].B + g_R4JupiterCoefficients[i].C * rho);
            }

            //Calculate R5
            int    nR5Coefficients = g_R5JupiterCoefficients.Length;
            double R5 = 0;

            for (i = 0; i < nR5Coefficients; i++)
            {
                R5 += g_R5JupiterCoefficients[i].A * Math.Cos(g_R5JupiterCoefficients[i].B + g_R5JupiterCoefficients[i].C * rho);
            }

            return((R0 + R1 * rho + R2 * rhosquared + R3 * rhocubed + R4 * rho4 + R5 * rho5) / 100000000);
        }
Ejemplo n.º 4
0
        public static double EclipticLongitude(double JD, bool bHighPrecision)
        {
            if (bHighPrecision)
            {
                return(AASCoordinateTransformation.MapTo0To360Range(AASCoordinateTransformation.RadiansToDegrees(AASVSOP87D_Jupiter.L(JD))));
            }

            double rho        = (JD - 2451545) / 365250;
            double rhosquared = rho * rho;
            double rhocubed   = rhosquared * rho;
            double rho4       = rhocubed * rho;
            double rho5       = rho4 * rho;

            //Calculate L0
            int    nL0Coefficients = g_L0JupiterCoefficients.Length;
            double L0 = 0;
            int    i;

            for (i = 0; i < nL0Coefficients; i++)
            {
                L0 += g_L0JupiterCoefficients[i].A * Math.Cos(g_L0JupiterCoefficients[i].B + g_L0JupiterCoefficients[i].C * rho);
            }

            //Calculate L1
            int    nL1Coefficients = g_L1JupiterCoefficients.Length;
            double L1 = 0;

            for (i = 0; i < nL1Coefficients; i++)
            {
                L1 += g_L1JupiterCoefficients[i].A * Math.Cos(g_L1JupiterCoefficients[i].B + g_L1JupiterCoefficients[i].C * rho);
            }

            //Calculate L2
            int    nL2Coefficients = g_L2JupiterCoefficients.Length;
            double L2 = 0;

            for (i = 0; i < nL2Coefficients; i++)
            {
                L2 += g_L2JupiterCoefficients[i].A * Math.Cos(g_L2JupiterCoefficients[i].B + g_L2JupiterCoefficients[i].C * rho);
            }

            //Calculate L3
            int    nL3Coefficients = g_L3JupiterCoefficients.Length;
            double L3 = 0;

            for (i = 0; i < nL3Coefficients; i++)
            {
                L3 += g_L3JupiterCoefficients[i].A * Math.Cos(g_L3JupiterCoefficients[i].B + g_L3JupiterCoefficients[i].C * rho);
            }

            //Calculate L4
            int    nL4Coefficients = g_L4JupiterCoefficients.Length;
            double L4 = 0;

            for (i = 0; i < nL4Coefficients; i++)
            {
                L4 += g_L4JupiterCoefficients[i].A * Math.Cos(g_L4JupiterCoefficients[i].B + g_L4JupiterCoefficients[i].C * rho);
            }

            //Calculate L5
            int    nL5Coefficients = g_L5JupiterCoefficients.Length;
            double L5 = 0;

            for (i = 0; i < nL5Coefficients; i++)
            {
                L5 += g_L5JupiterCoefficients[i].A * Math.Cos(g_L5JupiterCoefficients[i].B + g_L5JupiterCoefficients[i].C * rho);
            }

            double value = (L0 + L1 * rho + L2 * rhosquared + L3 * rhocubed + L4 * rho4 + L5 * rho5) / 100000000;

            //convert results back to degrees
            value = AASCoordinateTransformation.MapTo0To360Range(AASCoordinateTransformation.RadiansToDegrees(value));
            return(value);
        }