Ejemplo n.º 1
0
    void Update()
    {
        Sun.Rotate(Vector3.up * Time.deltaTime * 5);

        Mercury.RotateAround(Sun.position, new Vector3(0.1f, 1, 0), 60 * Time.deltaTime);
        Mercury.Rotate(Vector3.up * 10000 / 58 * Time.deltaTime);

        Venus.RotateAround(Sun.position, new Vector3(0, 1, -0.1f), 55 * Time.deltaTime);
        Venus.Rotate(Vector3.up * 10000 / 243 * Time.deltaTime);

        Earth.RotateAround(Sun.position, Vector3.up, 50 * Time.deltaTime);
        Earth.Rotate(Vector3.up * 10000 * Time.deltaTime);
        Moon.RotateAround(Earth.position, Vector3.up, 5 * Time.deltaTime);
        Moon.Rotate(Vector3.up * 10000 / 27 * Time.deltaTime);

        Mars.RotateAround(Sun.position, new Vector3(0.2f, 1, 0), 45 * Time.deltaTime);
        Mars.Rotate(Vector3.up * 10000 * Time.deltaTime);

        Jupiter.RotateAround(Sun.position, new Vector3(-0.1f, 2, 0), 38 * Time.deltaTime);
        Jupiter.Rotate(Vector3.up * 10000 / 0.3f * Time.deltaTime);

        Saturn.RotateAround(Sun.position, new Vector3(0, 1, 0.2f), 36 * Time.deltaTime);
        Saturn.Rotate(Vector3.up * 10000 / 0.4f * Time.deltaTime);

        Uranus.RotateAround(Sun.position, new Vector3(0, 2, 0.1f), 35 * Time.deltaTime);
        Uranus.Rotate(Vector3.up * 10000 / 0.6f * Time.deltaTime);

        Neptune.RotateAround(Sun.position, new Vector3(-0.1f, 1, -0.1f), 33 * Time.deltaTime);
        Neptune.Rotate(Vector3.up * 10000 / 0.7f * Time.deltaTime);
    }
Ejemplo n.º 2
0
        private void LoadSolarSystem()
        {
            _sun = new Sun(DVector2.Zero, DVector2.Zero);

            var mercury = new Mercury();
            var venus   = new Venus();
            var earth   = new Earth();
            var moon    = new Moon(earth.Position, earth.Velocity);
            var mars    = new Mars();
            var jupiter = new Jupiter();
            var europa  = new Europa(jupiter.Position + new DVector2(6.64862e8, 0), jupiter.Velocity + new DVector2(0, -13740));
            var saturn  = new Saturn();

            _massiveBodies = new List <IMassiveBody>
            {
                _sun, mercury, venus, earth, moon, mars, jupiter, europa, saturn
            };

            //_spaceCrafts = SpacecraftFactory.BuildFalconHeavy(earth, ProfileDirectory);
            //_spaceCrafts = SpacecraftFactory.BuildDragonV2Abort(earth, ProfileDirectory);
            _spaceCrafts = SpacecraftFactory.BuildDragonV2Entry(earth, ProfileDirectory);
            //_spaceCrafts = SpacecraftFactory.BuildF9(earth, ProfileDirectory);
            //_spaceCrafts = SpacecraftFactory.BuildF9Dragon(earth, ProfileDirectory);

            // Initialize the spacecraft controllers
            foreach (ISpaceCraft spaceCraft in _spaceCrafts)
            {
                spaceCraft.InitializeController(ProfileDirectory, _eventManager);
            }

            // Start at nearly -Math.Pi / 2
            _strongback = new Strongback(-1.5707947, _spaceCrafts[0].TotalHeight * 0.05, earth);

            // Start downrange at ~300km
            var asds = new ASDS(-1.62026, 20, earth);

            _gravitationalBodies = new List <IGravitationalBody>
            {
                _sun, mercury, venus, earth
            };

            foreach (ISpaceCraft spaceCraft in _spaceCrafts)
            {
                _gravitationalBodies.Add(spaceCraft);
            }

            _structures = new List <StructureBase>
            {
                _strongback, //asds
            };

            _gravitationalBodies.Add(moon);
            _gravitationalBodies.Add(mars);
            _gravitationalBodies.Add(jupiter);
            _gravitationalBodies.Add(europa);
            _gravitationalBodies.Add(saturn);

            // Target the spacecraft
            _targetIndex = _gravitationalBodies.IndexOf(_spaceCrafts.FirstOrDefault());
        }
Ejemplo n.º 3
0
        public IActionResult Index()
        {
            DateTime birthday  = new DateTime(1991, 6, 5, 8, 26, 00);
            Equator  equator   = Sun.EquatorialCoordinate(birthday);
            Ecliptic mooquator = Moon.EclipticalCoordinate(birthday);
            Ecliptic merquator = Mercury.EclipticalCoordinate(birthday);
            Ecliptic vequator  = Venus.EclipticalCoordinate(birthday);
            Ecliptic mequator  = Mars.EclipticalCoordinate(birthday);
            Ecliptic jequator  = Jupiter.EclipticalCoordinate(birthday);
            Ecliptic sequator  = Saturn.EclipticalCoordinate(birthday);
            Ecliptic urquator  = Uranus.EclipticalCoordinate(birthday);
            Ecliptic nequator  = Neptune.EclipticalCoordinate(DateTime.Now);
            Ecliptic ecliptic  = CoordinateSystem.Equatorial2Ecliptic(equator);

            Debug.WriteLine(DateTime.Now);
            Debug.WriteLine("SUN" + ecliptic.Longitude);
            Debug.WriteLine("Moon" + mooquator.Longitude);
            Debug.WriteLine("MERC: " + merquator.Longitude);
            Debug.WriteLine("VENUS" + vequator.Longitude);
            Debug.WriteLine("Mars" + mequator.Longitude);
            Debug.WriteLine("Jup: " + jequator.Longitude);
            Debug.WriteLine("Saturn: " + sequator.Longitude);
            Debug.WriteLine("Urnuas: " + urquator.Longitude);
            Debug.WriteLine("Neptune: " + nequator.Longitude);

            return(View());
        }
Ejemplo n.º 4
0
 private void image4_Tap(object sender, System.Windows.Input.GestureEventArgs e)
 {
     if (i == 1)
     {
         Jupiter.Begin();
         i = 2;
         PresentTheAttributes(4);
     }
 }
Ejemplo n.º 5
0
        private void LoadSolarSystem()
        {
            _sun = new Sun(DVector2.Zero, DVector2.Zero);

            var mercury = new Mercury();
            var venus   = new Venus();
            var earth   = new Earth();

            _strongback = new Strongback(new DVector2(10, -earth.SurfaceRadius + 38), earth);

            var moon    = new Moon(earth.Position, earth.Velocity);
            var mars    = new Mars();
            var jupiter = new Jupiter();
            var europa  = new Europa(jupiter.Position + new DVector2(6.64862e8, 0), jupiter.Velocity + new DVector2(0, -13740));
            var saturn  = new Saturn();

            _massiveBodies = new List <IMassiveBody>
            {
                _sun, mercury, venus, earth, moon, mars, jupiter, europa, saturn
            };

            _structures = new List <StructureBase>
            {
                _strongback
            };

            _spaceCrafts = SpacecraftFactory.BuildFalconHeavy(earth, ProfileDirectory);

            _gravitationalBodies = new List <IGravitationalBody>
            {
                _sun, mercury, venus, earth
            };

            foreach (ISpaceCraft spaceCraft in _spaceCrafts)
            {
                _gravitationalBodies.Add(spaceCraft);
            }

            _gravitationalBodies.Add(moon);
            _gravitationalBodies.Add(mars);
            _gravitationalBodies.Add(jupiter);
            _gravitationalBodies.Add(europa);
            _gravitationalBodies.Add(saturn);

            // Target the spacecraft
            _targetIndex = _gravitationalBodies.IndexOf(_spaceCrafts.FirstOrDefault());
        }
Ejemplo n.º 6
0
    void Start()
    {
        Mercury.AddComponent <Planet>().speed = 47.89f;
        Venus.AddComponent <Planet>().speed   = 35.03f;
        Earth.AddComponent <Planet>().speed   = 30f;
        Mars.AddComponent <Planet>().speed    = 24.13f;
        Jupiter.AddComponent <Planet>().speed = 13.06f;
        Saturn.AddComponent <Planet>().speed  = 9.64f;
        Uranus.AddComponent <Planet>().speed  = 6.81f;
        Neptune.AddComponent <Planet>().speed = 5.43f;
        Moon.AddComponent <Moon>().speed      = 300f;

        gs = new GUIStyle
        {
            fontSize = 35
        };
        gs.normal.textColor = new Color(1, 0, 0);
        gs.fontStyle        = FontStyle.Italic;
    }
Ejemplo n.º 7
0
        private void LoadSolarSystem()
        {
            _sun = new Sun();

            var mercury = new Mercury();
            var venus   = new Venus();
            var earth   = new Earth();
            var moon    = new Moon(earth.Position, earth.Velocity);
            var mars    = new Mars();
            var jupiter = new Jupiter();
            var europa  = new Europa(jupiter.Position, jupiter.Velocity);
            var saturn  = new Saturn();

            _massiveBodies = new List <IMassiveBody>
            {
                _sun, mercury, venus, earth, moon, mars, jupiter, europa, saturn
            };

            ResolveMassiveBodyParents();

            _spaceCrafts = new List <ISpaceCraft>();
            _structures  = new List <StructureBase>();

            MissionConfig primaryMission = MissionConfig.Load(ProfilePaths[0]);

            _originTime = primaryMission.GetLaunchDate();

            OrbitHelper.SimulateToTime(_massiveBodies, _originTime, 300);

            // Load missions
            for (int i = 0; i < ProfilePaths.Count; i++)
            {
                MissionConfig missionConfig = MissionConfig.Load(ProfilePaths[i]);

                IMassiveBody targetPlanet = LocatePlanet(missionConfig.ParentPlanet);

                double launchAngle = targetPlanet.GetSurfaceAngle(_originTime, _sun);

                _spaceCrafts.AddRange(SpacecraftFactory.BuildSpaceCraft(targetPlanet, launchAngle, missionConfig, ProfilePaths[i]));

                _structures.AddRange(StructureFactory.Load(targetPlanet, launchAngle, ProfilePaths[i]));
            }

            // Initialize the spacecraft controllers
            foreach (ISpaceCraft spaceCraft in _spaceCrafts)
            {
                spaceCraft.InitializeController(_eventManager);
            }

            _gravitationalBodies = new List <IGravitationalBody>
            {
                _sun, mercury, venus, earth, moon, mars, jupiter, europa, saturn
            };

            foreach (ISpaceCraft spaceCraft in _spaceCrafts)
            {
                _gravitationalBodies.Add(spaceCraft);
            }

            // Target the spacecraft
            _targetIndex = _gravitationalBodies.IndexOf(_spaceCrafts.FirstOrDefault());

            ResolveSpaceCraftParents();
        }
Ejemplo n.º 8
0
        private void LoadSolarSystem()
        {
            _sun = new Sun();

            var mercury = new Mercury();
            var venus   = new Venus();
            var earth   = new Earth();
            var moon    = new Moon(earth.Position, earth.Velocity);
            var mars    = new Mars();
            var jupiter = new Jupiter();
            var europa  = new Europa(jupiter.Position, jupiter.Velocity);
            var saturn  = new Saturn();

            _massiveBodies = new List <IMassiveBody>
            {
                _sun, mercury, venus, earth, moon, mars, jupiter, europa, saturn
            };

            ResolveMassiveBodyParents();

            // Simulate the planets out to May 2018 with a 6000 second time step
            OrbitHelper.SimulateToTime(_massiveBodies, new DateTime(2018, 5, 1), 300);

            _spaceCrafts = new List <ISpaceCraft>();

            for (int i = 0; i < ProfileDirectories.Count; i++)
            {
                string profileDirectory = ProfileDirectories[i];

                //List<ISpaceCraft> spaceCraft = SpacecraftFactory.BuildSpaceCraft(mars, profileDirectory, i * 30);
                List <ISpaceCraft> spaceCraft = SpacecraftFactory.BuildSpaceCraft(earth, profileDirectory, i * -60);

                _spaceCrafts.AddRange(spaceCraft);
            }

            // Initialize the spacecraft controllers
            foreach (ISpaceCraft spaceCraft in _spaceCrafts)
            {
                spaceCraft.InitializeController(_eventManager);
            }

            // Start at nearly -Math.Pi / 2
            var itsMount   = new ITSMount(-1.570795, -69, earth);
            var strongback = new Strongback(-1.5708048, -32, earth);

            // Start downrange at ~300km
            //var asds = new ASDS(-1.8303485, 26, earth);

            _gravitationalBodies = new List <IGravitationalBody>
            {
                _sun, mercury, venus, earth, moon, mars, jupiter, europa, saturn
            };

            foreach (ISpaceCraft spaceCraft in _spaceCrafts)
            {
                _gravitationalBodies.Add(spaceCraft);
            }

            _structures = new List <StructureBase>
            {
                itsMount,
                strongback,
                //asds
            };

            // Target the spacecraft
            _targetIndex = _gravitationalBodies.IndexOf(_spaceCrafts.FirstOrDefault());

            ResolveSpaceCraftParents();
        }
Ejemplo n.º 9
0
        private void LoadSolarSystem()
        {
            _sun = new Sun();

            var mercury = new Mercury();
            var venus   = new Venus();

            var earth = new Earth();
            var moon  = new Moon(earth.Position, earth.Velocity);

            var mars = new Mars();

            var jupiter  = new Jupiter();
            var callisto = new Callisto(jupiter.Position, jupiter.Velocity);
            var europa   = new Europa(jupiter.Position, jupiter.Velocity);
            var ganymede = new Ganymede(jupiter.Position, jupiter.Velocity);
            var io       = new Io(jupiter.Position, jupiter.Velocity);

            var saturn = new Saturn();

            _massiveBodies = new List <IMassiveBody>
            {
                _sun, mercury, venus, earth, moon, mars, jupiter, callisto, europa, ganymede, io, saturn
            };

            ResolveMassiveBodyParents();

            _gravitationalBodies = new List <IGravitationalBody>
            {
                _sun, mercury, venus, earth, moon, mars, jupiter, callisto, europa, ganymede, io, saturn
            };

            _spaceCraftManager = new SpaceCraftManager(_gravitationalBodies);
            _structures        = new List <StructureBase>();

            MissionConfig primaryMission = MissionConfig.Load(ProfilePaths[0]);

            _originTime = primaryMission.GetLaunchDate();

            UpdateLoadingPercentage(20);

            OrbitHelper.SimulateToTime(_massiveBodies, _originTime, 300, UpdateLoadingPercentage);

            UpdateLoadingPercentage(80);

            // Load missions
            for (int i = 0; i < ProfilePaths.Count; i++)
            {
                MissionConfig missionConfig = MissionConfig.Load(ProfilePaths[i]);

                if (missionConfig.ClockDelay > _clockDelay)
                {
                    _clockDelay = missionConfig.ClockDelay;
                }

                IMassiveBody targetPlanet = LocatePlanet(missionConfig.ParentPlanet);

                // Get the launch angle relative to the sun for the given time at the origin
                // and offset each vehicle by a certain amount on the surface
                double launchAngle = targetPlanet.GetSurfaceAngle(_originTime, _sun) + i * 0.00002;

                _spaceCraftManager.Add(SpacecraftFactory.BuildSpaceCraft(targetPlanet, launchAngle, missionConfig, ProfilePaths[i]));

                _structures.AddRange(StructureFactory.Load(targetPlanet, launchAngle, ProfilePaths[i]));
            }

            _spaceCraftManager.Initialize(_eventManager, _clockDelay);

            // Target the spacecraft
            _targetIndex = _gravitationalBodies.IndexOf(_spaceCraftManager.First);

            _spaceCraftManager.ResolveGravitionalParents(_massiveBodies);

            UpdateLoadingPercentage(90);
        }
Ejemplo n.º 10
0
        static async Task Main(string[] args)
        {
            var config = JsonConvert.DeserializeObject <Config>(await File.ReadAllTextAsync("config.json"));

            foreach (Search search in config.Searches)
            {
                var clientIds = search.ClientId.Split(',');
                var clients   = config.Clients.Where(c => search.ClientId == "*" || c.Id == search.ClientId || clientIds.Contains(c.Id));

                if (!clients.Any())
                {
                    Console.WriteLine(search.ClientId + " is invalid client for search " + search.Name);
                    continue;
                }

                foreach (var client in clients)
                {
                    List <string> loadedMeetings = new List <string>();

                    if (!Directory.Exists(Path.Combine(client.Name, search.Phrase)))
                    {
                        Directory.CreateDirectory(Path.Combine(client.Name, search.Phrase));
                    }

                    string seenMeetingsPath = Path.Combine(client.Name, search.Phrase, "meetings.txt");

                    if (File.Exists(seenMeetingsPath))
                    {
                        loadedMeetings = (await File.ReadAllTextAsync(seenMeetingsPath)).Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries).ToList();
                    }

                    HashSet <string> seenMeetings = new HashSet <string>(loadedMeetings);

                    IScraper scraper = null;

                    if (!string.IsNullOrEmpty(client.OpenGovId))
                    {
                        scraper = new OpenGov.Scrapers.OpenGov(client.OpenGovId);
                    }
                    else if (!string.IsNullOrEmpty(client.JupiterUrl))
                    {
                        scraper = new Jupiter(client.JupiterUrl);
                    }
                    else if (!string.IsNullOrEmpty(client.SRUUrl))
                    {
                        scraper = new SRU(new Uri(client.SRUUrl));
                    }
                    else if (!string.IsNullOrEmpty(client.ACOSUrl))
                    {
                        scraper = new ACOS(new Uri(client.ACOSUrl));
                    }
                    else if (!string.IsNullOrEmpty(client.ElementsUrl))
                    {
                        scraper = new Elements(new Uri(client.ElementsUrl));
                    }

                    try
                    {
                        IEnumerable <Meeting> newMeetings = await scraper.FindMeetings(search.Phrase.ToLower(), seenMeetings);

                        if (newMeetings.Any())
                        {
                            seenMeetings.UnionWith(newMeetings.Select(meeting => meeting.Url.ToString()));

                            MailMessage email = new MailMessage(config.Smtp.Sender, client.NotifyEmail);
                            email.Subject = "Nye møter for " + search.Name + " i " + client.Name;

                            StringBuilder body = new StringBuilder();
                            body.AppendFormat("<h3>Nye møter har dukket opp på kalenderen for {0} i {1}:</h3>\r\n\r\n<table>", search.Name, client.Name);

                            foreach (var meeting in newMeetings.OrderByDescending(m => m.Date))
                            {
                                body.AppendFormat("<tr><td><a href=\"{1}\">{2}</a></td><td><a href=\"{1}\">{0}</a></td><td><a href=\"{1}\">{3}</a></td></tr>\r\n", meeting.BoardName, meeting.Url, meeting.Date.ToString("dd.MM.yyyy"), meeting.Title);
                            }

                            body.Append("</table>");

                            email.Body                 = body.ToString();
                            email.IsBodyHtml           = true;
                            email.BodyEncoding         = Encoding.UTF8;
                            email.BodyTransferEncoding = TransferEncoding.Base64;

                            SmtpClient smtp = new SmtpClient(config.Smtp.Server, config.Smtp.Port);
                            smtp.UseDefaultCredentials = false;
                            smtp.Credentials           = new NetworkCredential(config.Smtp.Sender, config.Smtp.Password);
                            smtp.EnableSsl             = true;

                            NEVER_EAT_POISON_Disable_CertificateValidation();

                            await smtp.SendMailAsync(email);

                            using (var file = new StreamWriter(new FileStream(seenMeetingsPath, FileMode.Create, FileAccess.Write)))
                            {
                                foreach (string meetingUrl in seenMeetings)
                                {
                                    await file.WriteLineAsync(meetingUrl);
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                    }
                }
            }
        }
Ejemplo n.º 11
0
        public void SetJupiterData()
        {
            Ecliptic jupquator = Jupiter.EclipticalCoordinate(BirthDate);

            UserJupiter = jupquator.Longitude;
        }
Ejemplo n.º 12
0
        public IActionResult Index(double latitude = 39.56, double longitude = 116.23, DateTime time = default, string zone = default)
        {
            if (time == default)
            {
                time = DateTime.Now;
            }

            TimeZoneInfo timeZone;

            if (string.IsNullOrEmpty(zone))
            {
                timeZone = TimeZoneInfo.Local;
            }
            else
            {
                timeZone = TimeZoneInfo.FindSystemTimeZoneById(zone);
            }

            Sun     sun     = new Sun(latitude, longitude, time, timeZone);
            Mercury mercury = new Mercury(latitude, longitude, time, timeZone);
            Venus   venus   = new Venus(latitude, longitude, time, timeZone);
            Mars    mars    = new Mars(latitude, longitude, time, timeZone);
            Jupiter jupiter = new Jupiter(latitude, longitude, time, timeZone);
            Saturn  saturn  = new Saturn(latitude, longitude, time, timeZone);
            Uranus  uranus  = new Uranus(latitude, longitude, time, timeZone);
            Neptune neptune = new Neptune(latitude, longitude, time, timeZone);

            double[] ra = new[] { sun.Equator.RA, mercury.Equator.RA, venus.Equator.RA, mars.Equator.RA,
                                  jupiter.Equator.RA, saturn.Equator.RA, uranus.Equator.RA, neptune.Equator.RA };
            double[] dec = new[] { sun.Equator.Dec, mercury.Equator.Dec, venus.Equator.Dec, mars.Equator.Dec,
                                   jupiter.Equator.Dec, saturn.Equator.Dec, uranus.Equator.Dec, neptune.Equator.Dec };
            TimeSpan[] rising = new[] { sun.Rising, mercury.Rising, venus.Rising, mars.Rising,
                                        jupiter.Rising, saturn.Rising, uranus.Rising, neptune.Rising };
            TimeSpan[] culmination = new[] { sun.Culmination, mercury.Culmination, venus.Culmination, mars.Culmination,
                                             jupiter.Culmination, saturn.Culmination, uranus.Culmination, neptune.Culmination };
            TimeSpan[] setting = new[] { sun.Setting, mercury.Setting, venus.Setting, mars.Setting,
                                         jupiter.Setting, saturn.Setting, uranus.Setting, neptune.Setting };
            double[] toEarth = new[] { sun.ToEarth, mercury.ToEarth, venus.ToEarth, mars.ToEarth,
                                       jupiter.ToEarth, saturn.ToEarth, uranus.ToEarth, neptune.ToEarth };
            double[] toSun = new[] { 0, mercury.ToSun, venus.ToSun, mars.ToSun,
                                     jupiter.ToSun, saturn.ToSun, uranus.ToSun, neptune.ToSun };
            double[] ea = new[] { sun.ElevationAngle, mercury.ElevationAngle, venus.ElevationAngle, mars.ElevationAngle,
                                  jupiter.ElevationAngle, saturn.ElevationAngle, uranus.ElevationAngle, neptune.ElevationAngle };
            double[] az = new[] { sun.Azimuth, mercury.Azimuth, venus.Azimuth, mars.Azimuth,
                                  jupiter.Azimuth, saturn.Azimuth, uranus.Azimuth, neptune.Azimuth };

            ViewData["Latitude"]  = latitude;
            ViewData["Longitude"] = longitude;
            ViewData["Time"]      = time;
            ViewData["Zone"]      = timeZone.Id;

            ViewData["RA"]          = ra;
            ViewData["Dec"]         = dec;
            ViewData["Rising"]      = rising;
            ViewData["Culmination"] = culmination;
            ViewData["Setting"]     = setting;
            ViewData["ToEarth"]     = toEarth;
            ViewData["ToSun"]       = toSun;
            ViewData["EA"]          = ea;
            ViewData["Az"]          = az;

            return(View());
        }
Ejemplo n.º 13
0
        private static List <MoonViewModel> CalculateMoonPositionsForDate(DateTime dt)
        {
            // assumes midnight on the date
            Moment  moment  = new Moment(dt);
            Earth   earth   = new Earth(moment);
            Jupiter jupiter = new Jupiter(moment);

            // calculate lower accuracy ephemerides for Jupiter and Earth

            double d = moment.DayD;
            Angle  V = jupiter.LongPeriodTerm;
            Angle  J = jupiter.DeltaHeliocentricLongitudeEarthAndJupiter;
            Angle  A = earth.EquationOfCenter;
            Angle  B = jupiter.EquationOfCenter;
            Angle  K = new Angle(J.Degrees + A.Degrees - B.Degrees);

            // R, r, and delta are distances expressed in astronomical units (AU)
            double R = earth.RadiusVector;
            double r = jupiter.RadiusVector;

            // distance from Earth to Jupiter in AU
            double delta = Math.Sqrt((r * r) + (R * R) - 2 * r * R * Math.Cos(K.Radians));

            // phase angle of Jupiter; psi always lies between -12 and +12 degrees
            double psi      = Math.Asin(R / delta * Math.Sin(K.Radians));
            Angle  psiAngle = new Angle(psi.ToDegrees());

            // Jupiter's heliocentric longitude referred to the equinox of 2000.0
            double lambda      = 34.35 + 0.083091 * d + 0.329 * Math.Sin(V.Radians) + B.Degrees;
            Angle  lambdaAngle = new Angle(lambda);

            // Jupiter's inclination of the equator on the orbital plane is 3.12 degrees
            double Ds = 3.12 * Math.Sin(lambdaAngle.Radians + 0.74700091985);

            // Jupiter's inclination of the equator on the ecliptic is 2.22 degrees
            double Dx = 2.22 * Math.Sin(psiAngle.Radians) * Math.Cos(lambdaAngle.Radians + 0.38397243544);

            // Jupiter's inclination of the orbital plane on the ecliptic is 1.30 degrees
            double Dy = 1.30 * ((r - delta) / delta) * Math.Sin(lambdaAngle.Radians - 1.7540558983);

            // planetocentric declination De of the Earth
            double De = Ds - Dx - Dy;

            // Chap 44 algorithms

            // correction for light time in days; see p. 298
            double t = delta / 173;

            double u1 = 163.8069 + 203.4058646 * (d - t) + psiAngle.Degrees - B.Degrees;
            double u2 = 358.4140 + (101.2916335 * (d - t)) + psiAngle.Degrees - B.Degrees;
            double u3 = 5.7176 + (50.2345180 * (d - t)) + psiAngle.Degrees - B.Degrees;
            double u4 = 224.8092 + (21.4879800 * (d - t)) + psiAngle.Degrees - B.Degrees;

            // reduce to interval 0 to 360
            u1 = u1.CorrectDegreeRange();
            u2 = u2.CorrectDegreeRange();
            u3 = u3.CorrectDegreeRange();
            u4 = u4.CorrectDegreeRange();

            double G = 331.18 + 50.310482 * (d - t);
            double H = 87.45 + 21.569231 * (d - t);

            double r1 = 5.9057 - 0.0244 * Math.Cos(2 * (u1 - u2).ToRadians());
            double r2 = 9.3966 - 0.0882 * Math.Cos(2 * (u2 - u3).ToRadians());
            double r3 = 14.9883 - 0.0216 * Math.Cos(G.ToRadians());
            double r4 = 26.3627 - 0.1939 * Math.Cos(H.ToRadians());

            // Satellite I (Io)
            double x1 = r1 * Math.Sin(u1.ToRadians());
            double y1 = -r1 *Math.Cos(u1.ToRadians()) * Math.Sin(De.ToRadians());

            // Satellite II (Europa)
            double x2 = r2 * Math.Sin(u2.ToRadians());
            double y2 = -r2 *Math.Cos(u2.ToRadians()) * Math.Sin(De.ToRadians());

            // Satellite III (Ganymede)
            double x3 = r3 * Math.Sin(u3.ToRadians());
            double y3 = -r3 *Math.Cos(u3.ToRadians()) * Math.Sin(De.ToRadians());

            // Satellite IV (Callisto)
            double x4 = r4 * Math.Sin(u4.ToRadians());
            double y4 = -r4 *Math.Cos(u4.ToRadians()) * Math.Sin(De.ToRadians());

            var i = new MoonViewModel {
                Position = "I", Name = "Io", Date = dt, X = x1, Y = y1
            };
            var ii = new MoonViewModel {
                Position = "II", Name = "Europa", Date = dt, X = x2, Y = y2
            };
            var iii = new MoonViewModel {
                Position = "III", Name = "Ganymede", Date = dt, X = x3, Y = y3
            };
            var iv = new MoonViewModel {
                Position = "IV", Name = "Callisto", Date = dt, X = x4, Y = y4
            };

            return(new List <MoonViewModel>
            {
                i,
                ii,
                iii,
                iv
            });
        }