Пример #1
0
        public void MercuryPositionTest()
        {
            OrbitingBodyMathematics mercury = OrbitingBodyMathematics.generate_mercury();
            var test_time = new DateTime(2016, 2, 10);

            PositionTest(mercury, test_time, 224.43, 0.13, 0.451);
        }
Пример #2
0
        public void MarsPositionTest()
        {
            OrbitingBodyMathematics mars = OrbitingBodyMathematics.generate_mars();
            var test_time = new DateTime(2016, 2, 10);

            PositionTest(mars, test_time, 192.34, 1.13, 1.634);
        }
Пример #3
0
        public void MercuryMeanAnomalyTest()
        {
            OrbitingBodyMathematics mercury = OrbitingBodyMathematics.generate_mercury();
            var test_time = new DateTime(2016, 2, 10, 11, 48, 00);

            MeanAnomalyTest(2.34, test_time, mercury);
        }
Пример #4
0
        public void JupiterPositionTest()
        {
            OrbitingBodyMathematics jupiter = OrbitingBodyMathematics.generate_jupiter();
            var test_time = new DateTime(2016, 2, 10);

            PositionTest(jupiter, test_time, 166.22, 1.19, 5.418);
        }
Пример #5
0
        public void VenusMeanAnomalyTest()
        {
            OrbitingBodyMathematics venus = OrbitingBodyMathematics.generate_venus();
            var test_time = new DateTime(2016, 2, 10, 12, 17, 00);

            MeanAnomalyTest(2.045, test_time, venus);
        }
Пример #6
0
        public void JupiterEccentricAnomalyTest()
        {
            OrbitingBodyMathematics jupiter = OrbitingBodyMathematics.generate_jupiter();
            var test_time = new DateTime(2016, 2, 10, 13, 27, 00);

            EccentricAnomalyTest(2.623, test_time, jupiter);
        }
Пример #7
0
        public void NeptuneEccentricAnomalyTest()
        {
            OrbitingBodyMathematics neptune = OrbitingBodyMathematics.generate_neptune();
            var test_time = new DateTime(2016, 2, 10, 14, 31, 00);

            EccentricAnomalyTest(5.077, test_time, neptune);
        }
Пример #8
0
        /// <summary>
        /// Alternate constructor which is used for moons etc.
        /// as it specifies an orbital target directly.
        /// Currently does not allow for a rotation value.
        /// </summary>
        /// <param name="semi_major_axis"></param>
        /// <param name="eccentricity"></param>
        /// <param name="time_last_at_periapsis"></param>
        /// <param name="inclination"></param>
        /// <param name="longitude_of_ascending_node"></param>
        /// <param name="longitude_of_periapsis"></param>
        /// <param name="mass"></param>
        /// <param name="orbiting_target"></param>
        /// <param name="orbiting_target_mass"></param>
        /// <param name="rotation_period"></param>
        /// <param name="time_last_at_original_rotation"></param>
        public OrbitingBodyMathematics(
            double semi_major_axis,
            double eccentricity,
            DateTime time_last_at_periapsis,
            double inclination,
            double longitude_of_ascending_node,
            double longitude_of_periapsis, // argument_of_periapsis
            double mass,
            OrbitingBodyMathematics orbiting_target,
            double orbiting_target_mass
            )
        {
            this.semi_major_axis             = semi_major_axis;
            this.eccentricity                = eccentricity;
            this.time_last_at_periapsis      = time_last_at_periapsis;
            this.inclination                 = inclination;
            this.longitude_of_ascending_node = longitude_of_ascending_node;
            this.longitude_of_periapsis      = longitude_of_periapsis;
            this.mass = mass;

            this.orbital_period = 2 * Math.PI * Math.Sqrt(
                Math.Pow(semi_major_axis * DISTANCE_SCALE_TO_METRES, 3.0)
                / (CONSTANT_OF_GRAVITATION * (orbiting_target_mass * MASS_SCALE_TO_KG + mass * MASS_SCALE_TO_KG))
                );

            setup();
        }
Пример #9
0
        public void SaturnPositionTest()
        {
            OrbitingBodyMathematics saturn = OrbitingBodyMathematics.generate_saturn();
            var test_time = new DateTime(2016, 2, 10);

            PositionTest(saturn, test_time, 250.37, 1.71, 10.002);
        }
Пример #10
0
        public void UranusEccentricAnomalyTest()
        {
            OrbitingBodyMathematics uranus = OrbitingBodyMathematics.generate_uranus();
            var test_time = new DateTime(2016, 2, 10, 14, 19, 00);

            EccentricAnomalyTest(3.644, test_time, uranus);
        }
Пример #11
0
        public void EarthPositionTest()
        {
            OrbitingBodyMathematics earth = OrbitingBodyMathematics.generate_earth();
            var test_time = new DateTime(2016, 2, 10);

            PositionTest(earth, test_time, 140.65, 0.0, 0.987);
        }
Пример #12
0
        public void MoonOrbitalPeriodTest()
        {
            OrbitingBodyMathematics earth = OrbitingBodyMathematics.generate_earth();
            OrbitingBodyMathematics moon  = OrbitingBodyMathematics.generate_moon(earth);

            OrbitalPeriodTest(27.3217, moon);
        }
Пример #13
0
        public void EarthMeanAnomalyTest2()
        {
            OrbitingBodyMathematics earth = OrbitingBodyMathematics.generate_earth();
            var test_time = new DateTime(2016, 2, 10, 9, 54, 00);

            MeanAnomalyTest(0.6577, test_time, earth);
        }
Пример #14
0
        public void EarthEccentricAnomalyTest()
        {
            OrbitingBodyMathematics earth = OrbitingBodyMathematics.generate_earth();
            var test_time = new DateTime(2016, 2, 10, 13, 25, 00);

            EccentricAnomalyTest(0.6705, test_time, earth);
        }
Пример #15
0
        public void EarthMeanAnomalyTest1()
        {
            OrbitingBodyMathematics earth = OrbitingBodyMathematics.generate_earth();
            var test_time = new DateTime(2016, 2, 9, 14, 49, 00);

            MeanAnomalyTest(0.6441, test_time, earth);
        }
Пример #16
0
        public void VenusPositionTest()
        {
            OrbitingBodyMathematics venus = OrbitingBodyMathematics.generate_venus();
            var test_time = new DateTime(2016, 2, 10);

            PositionTest(venus, test_time, 249.01, 0.46, 0.726);
        }
Пример #17
0
        public void VenusEccentricAnomalyTest()
        {
            OrbitingBodyMathematics venus = OrbitingBodyMathematics.generate_venus();
            var test_time = new DateTime(2016, 2, 10, 12, 18, 00);

            EccentricAnomalyTest(2.051, test_time, venus);
        }
Пример #18
0
        public void SaturnMeanAnomalyTest()
        {
            OrbitingBodyMathematics saturn = OrbitingBodyMathematics.generate_saturn();
            var test_time = new DateTime(2016, 2, 10, 13, 43, 00);

            MeanAnomalyTest(2.685, test_time, saturn);
        }
Пример #19
0
        public static OrbitingBodyMathematics generate_earth()
        {
            // from http://aa.usno.navy.mil/data/docs/EarthSeasons.php
            var last_earth_perihelion = new DateTime(2016, 1, 2, 22, 49, 0);

            // from http://nssdc.gsfc.nasa.gov/planetary/factsheet/earthfact.html
            OrbitingBodyMathematics return_maths = new OrbitingBodyMathematics(
                149.60, 0.01671022, last_earth_perihelion,
                0.00005, -11.26064, 102.94719, 5.9726
                );

            // relative to the stars NOT to the sun
            // from https://en.wikipedia.org/wiki/Earth%27s_rotation#Stellar_and_sidereal_day
            double earth_rotation_period = 86164.098;
            // Assumed/approximated
            var last_earth_facing_the_sun
                = new DateTime(2016, 11, 2, 12, 00, 00);
            //Debug.Log("Last time facing the sun: " + last_earth_facing_the_sun);
            Vector3 earth_position_when_facing_the_sun
                = return_maths.current_location(last_earth_facing_the_sun);
            DateTime last_time_facing_stellar_north
                = CaclulateLastTimeFacingStellarNorth(
                      earth_rotation_period,
                      last_earth_facing_the_sun,
                      earth_position_when_facing_the_sun
                      );

            return_maths.time_last_at_original_rotation = last_time_facing_stellar_north;
            return_maths.rotation_period = earth_rotation_period;
            return_maths.default_rotation_tilt_euler_angle
                = new Vector3(-23.4f, 180.0f, 0);
            return_maths.rotation_elements_set = true;

            return(return_maths);
        }
Пример #20
0
        public void SaturnEccentricAnomalyTest()
        {
            OrbitingBodyMathematics saturn = OrbitingBodyMathematics.generate_saturn();
            var test_time = new DateTime(2016, 2, 10, 13, 44, 00);

            EccentricAnomalyTest(2.707, test_time, saturn);
        }
Пример #21
0
        public void MarsMeanAnomalyTest()
        {
            OrbitingBodyMathematics mars = OrbitingBodyMathematics.generate_mars();
            var test_time = new DateTime(2016, 2, 10, 12, 32, 00);

            MeanAnomalyTest(3.887, test_time, mars);
        }
Пример #22
0
        public void UranusMeanAnomalyTest()
        {
            OrbitingBodyMathematics uranus = OrbitingBodyMathematics.generate_uranus();
            var test_time = new DateTime(2016, 2, 10, 14, 18, 00);

            MeanAnomalyTest(3.666, test_time, uranus);
        }
Пример #23
0
        public void MarsEccentricAnomalyTest()
        {
            OrbitingBodyMathematics mars = OrbitingBodyMathematics.generate_mars();
            var test_time = new DateTime(2016, 2, 10, 12, 33, 00);

            EccentricAnomalyTest(3.828, test_time, mars);
        }
Пример #24
0
        public void UranusPositionTest()
        {
            OrbitingBodyMathematics uranus = OrbitingBodyMathematics.generate_uranus();
            var test_time = new DateTime(2016, 2, 10);

            PositionTest(uranus, test_time, 20.32, -0.63, 19.924);
        }
Пример #25
0
        public void MercuryEccentricAnomalyTest()
        {
            OrbitingBodyMathematics mercury = OrbitingBodyMathematics.generate_mercury();
            var test_time = new DateTime(2016, 2, 10, 11, 49, 0);

            EccentricAnomalyTest(2.468, test_time, mercury);
        }
Пример #26
0
        public void NeptunePositionTest()
        {
            OrbitingBodyMathematics neptune = OrbitingBodyMathematics.generate_neptune();
            var test_time = new DateTime(2016, 2, 10);

            PositionTest(neptune, test_time, 339.59, -0.81, 29.898);
        }
Пример #27
0
        public void JupiterMeanAnomalyTest()
        {
            OrbitingBodyMathematics jupiter = OrbitingBodyMathematics.generate_jupiter();
            var test_time = new DateTime(2016, 2, 10, 13, 12, 00);

            MeanAnomalyTest(2.599, test_time, jupiter);
        }
Пример #28
0
        public void MercuryCompoundPositionTest()
        {
            OrbitingBodyMathematics Mercury = OrbitingBodyMathematics.generate_mercury();

            CompoundPositionTester[] Tests =
            {
                new CompoundPositionTester(new DateTime(1968, 12,  3),  243.9, -1.93,  0.464),
                new CompoundPositionTester(new DateTime(1968, 11,  2), 127.03,  6.88,  0.327),
                new CompoundPositionTester(new DateTime(1968,  5, 18), 166.95,  6.14,  0.370),
                new CompoundPositionTester(new DateTime(1968,  3, 28), 282.52, -5.71,  0.455),
                new CompoundPositionTester(new DateTime(1968, 10, 17),  29.83,  -2.2,  0.325),
                new CompoundPositionTester(new DateTime(1968,  4, 27),  47.01, -0.12,  0.315),
                new CompoundPositionTester(new DateTime(1968, 11,  4), 138.06,  7.00,  0.337),
                new CompoundPositionTester(new DateTime(1968,  7,  4), 314.24, -6.99,  0.417),
                new CompoundPositionTester(new DateTime(1968, 12, 27), 314.45, -6.99,  0.417),
                new CompoundPositionTester(new DateTime(1968,  4, 16), 349.09, -6.01,  0.368),
                new CompoundPositionTester(new DateTime(1985,  4, 11), 218.18,  1.22,  0.441),
                new CompoundPositionTester(new DateTime(1985,  9, 27), 195.41,  3.80,  0.410),
                new CompoundPositionTester(new DateTime(1985,  3, 13),  85.48,  4.26,  0.308),
                new CompoundPositionTester(new DateTime(1985,  4, 17), 235.92, -0.95,  0.459),
                new CompoundPositionTester(new DateTime(1985,  5, 11), 304.89, -6.82,  0.430),
                new CompoundPositionTester(new DateTime(1985, 12, 30), 215.37,  1.56,  0.438),
                new CompoundPositionTester(new DateTime(1985,  6, 16), 127.96,  6.89,  0.328),
                new CompoundPositionTester(new DateTime(1985,  1, 31), 268.92, -4.59,  0.464),
                new CompoundPositionTester(new DateTime(1985,  3, 30), 176.28,  5.52,  0.383),
                new CompoundPositionTester(new DateTime(1985,  6,  4),  54.45,  0.77,  0.312),
                new CompoundPositionTester(new DateTime(2008, 10, 19),  85.92,  4.28,  0.308),
                new CompoundPositionTester(new DateTime(2008,  7,  5), 345.85, -6.22, 0.3737),
                new CompoundPositionTester(new DateTime(2008,  8,  5), 159.05,  6.56,  0.360),
                new CompoundPositionTester(new DateTime(2008,  9, 27), 329.74, -6.87,  0.396),
                new CompoundPositionTester(new DateTime(2008,  4, 20),  48.24, -0.02,  0.314),
                new CompoundPositionTester(new DateTime(2008, 12, 25), 333.74, -6.87,  0.396),
                new CompoundPositionTester(new DateTime(2008,  7, 21),  73.15,  2.95,  0.308),
                new CompoundPositionTester(new DateTime(2008,  5, 16), 188.06,  4.55,  0.399),
                new CompoundPositionTester(new DateTime(2008,  7,  9),   4.29, -4.89,  0.350),
                new CompoundPositionTester(new DateTime(2008,  1, 11), 345.58, -6.24,  0.373),
                new CompoundPositionTester(new DateTime(1987,  6, 20), 242.36, -1.72,  0.463),
                new CompoundPositionTester(new DateTime(1987,  7, 22), 342.69, -6.38,  0.377),
                new CompoundPositionTester(new DateTime(1987,  5, 15),  93.51,  4.99,  0.310),
                new CompoundPositionTester(new DateTime(1987,  3, 30), 258.72, -3.57,  0.467),
                new CompoundPositionTester(new DateTime(1987, 11,  5),  81.36,  3.85,  0.308),
                new CompoundPositionTester(new DateTime(1987,  5, 21), 129.37,  6.92,  0.329),
                new CompoundPositionTester(new DateTime(1987, 10, 23),   5.76, -4.74,  0.348),
                new CompoundPositionTester(new DateTime(1987, 11,  9), 106.25,  5.95,  0.314),
                new CompoundPositionTester(new DateTime(1987, 12, 31), 293.32, -6.36,  0.444),
                new CompoundPositionTester(new DateTime(1987, 12,  2), 209.82,  2.22,  0.430),
                new CompoundPositionTester(new DateTime(1973,  3, 23), 206.80,  2.55,  0.427),
                new CompoundPositionTester(new DateTime(1973,  9,  3), 161.09,  6.45,  0.363),
                new CompoundPositionTester(new DateTime(1973,  3, 20), 196.66,  3.66,  0.412),
                new CompoundPositionTester(new DateTime(1973,  2,  9), 351.91, -5.83,  0.365),
                new CompoundPositionTester(new DateTime(1973, 11, 19), 101.23,  5.62,  0.312),
                new CompoundPositionTester(new DateTime(1973,  1,  4), 237.01, -1.10,  0.459),
                new CompoundPositionTester(new DateTime(1973,  2, 24),  75.63,  3.26,  0.308),
                new CompoundPositionTester(new DateTime(1973,  1, 28), 306.16, -6.86,  0.428),
                new CompoundPositionTester(new DateTime(1973,  6, 21), 213.33,  1.79,  0.435),
                new CompoundPositionTester(new DateTime(1973,  4, 28), 312.97, -6.98, 0.419)
            };
            CompoundPositionTest(Mercury, Tests);
        }
Пример #29
0
        public static OrbitingBodyMathematics generate_moon(OrbitingBodyMathematics earth)
        {
            // from https://www.fourmilab.ch/earthview/pacalc.html
            var last_perigee = new DateTime(2016, 2, 11, 14, 43, 0);

            // from http://nssdc.gsfc.nasa.gov/planetary/factsheet/earthfact.html
            return(new OrbitingBodyMathematics(0.3844, 0.0549, last_perigee, 5.145, 125.08, 83.23, 0.07342, earth, earth.mass));
        }
Пример #30
0
        public void MoonEccentricAnomalyTest()
        {
            OrbitingBodyMathematics earth = OrbitingBodyMathematics.generate_earth();
            OrbitingBodyMathematics moon  = OrbitingBodyMathematics.generate_moon(earth);
            var test_time = new DateTime(2016, 2, 23, 10, 30, 00);

            EccentricAnomalyTest(2.768, test_time, moon);
        }