public Form1()
        {
            InitializeComponent();
            ///
            /// JEDNOTKY, KONSTANTY:
            /// Hmotnost - Hmotnost slunce = 1
            ///  Rychlost - Oběžná rychlost Země = 1
            ///  Délka - 1 au
            ///  G = 1
            ///
            Body[] bds = new Body[] {
                new Body("Sun", 1f, new Vector(0f, 0f), new Vector(0f, 0f), Color.Orange)
                , new Body("Mercury", 1.660f * (float)Math.Pow(10, -7), VOSP87.getPlanetVelocity("mer", 2458120, 0.5f).toVector(), VOSP87.getPlanetPosition("mer", 2458120).toVector(), Color.PaleVioletRed)
                , new Body("Venus", 2.450f * (float)Math.Pow(10, -6), VOSP87.getPlanetVelocity("ven", 2458120, 0.5f).toVector(), VOSP87.getPlanetPosition("ven", 2458120).toVector(), Color.OrangeRed)
                , new Body("Earth", 3f * (float)Math.Pow(10, -6), VOSP87.getPlanetVelocity("ear", 2458120, 0.5f).toVector(), VOSP87.getPlanetPosition("ear", 2458120).toVector(), Color.Blue)
                , new Body("Moon", 3.694f * (float)Math.Pow(10, -8), Moons.getVelocity(VOSP87.getPlanetVelocity("ear", 2458120, 0.5f).toVector(), 0.0336f), Moons.getPosition(VOSP87.getPlanetPosition("ear", 2458120).toVector(), 0.002663f), Color.Gray)
                , new Body("Mars", 3.230f * (float)Math.Pow(10, -7), VOSP87.getPlanetVelocity("mar", 2458120, 0.5f).toVector(), VOSP87.getPlanetPosition("mar", 2458120).toVector(), Color.Red)
                , new Body("Jupiter", 9.540f * (float)Math.Pow(10, -4), VOSP87.getPlanetVelocity("jup", 2458120, 0.5f).toVector(), VOSP87.getPlanetPosition("jup", 2458120).toVector(), Color.DarkOrange)
                , new Body("Io", 4.491944f * (float)Math.Pow(10, -8), Moons.getVelocity(VOSP87.getPlanetVelocity("jup", 2458120, 0.5f).toVector(), 0.58f), Moons.getPosition(VOSP87.getPlanetPosition("jup", 2458120).toVector(), 0.00281935f), Color.DarkRed)
                , new Body("Ganymede", 7.4506f * (float)Math.Pow(10, -8), Moons.getVelocity(VOSP87.getPlanetVelocity("jup", 2458120, 0.5f).toVector(), 0.3592f), Moons.getPosition(VOSP87.getPlanetPosition("jup", 2458120).toVector(), 0.0071552f), Color.YellowGreen)
                , new Body("Europa", 2.4133f * (float)Math.Pow(10, -8), Moons.getVelocity(VOSP87.getPlanetVelocity("jup", 2458120, 0.5f).toVector(), -0.45235f), Moons.getPosition(VOSP87.getPlanetPosition("jup", 2458120).toVector(), -0.004486f), Color.WhiteSmoke)
                , new Body("Callisto", 5.41098f * (float)Math.Pow(10, -8), Moons.getVelocity(VOSP87.getPlanetVelocity("jup", 2458120, 0.5f).toVector(), -0.275f), Moons.getPosition(VOSP87.getPlanetPosition("jup", 2458120).toVector(), -0.012585f), Color.DimGray)
                , new Body("Saturn", 2.860f * (float)Math.Pow(10, -4), VOSP87.getPlanetVelocity("sat", 2458120, 0.5f).toVector(), VOSP87.getPlanetPosition("sat", 2458120).toVector(), Color.Orange)
                , new Body("Titan", 6.7652f * (float)Math.Pow(10, -8), Moons.getVelocity(VOSP87.getPlanetVelocity("sat", 2458120, 0.5f).toVector(), 0.1839f), Moons.getPosition(VOSP87.getPlanetPosition("sat", 2458120).toVector(), 0.00817108f), Color.White)
                , new Body("Enceladus", 5.433f * (float)Math.Pow(10, -11), Moons.getVelocity(VOSP87.getPlanetVelocity("sat", 2458120, 0.5f).toVector(), 0.424f), Moons.getPosition(VOSP87.getPlanetPosition("sat", 2458120).toVector(), 0.00159122f), Color.GhostWhite)
                , new Body("Uranus", 4.370f * (float)Math.Pow(10, -5), VOSP87.getPlanetVelocity("ura", 2458120, 0.5f).toVector(), VOSP87.getPlanetPosition("ura", 2458120).toVector(), Color.Teal)
                , new Body("Neptune", 5.150f * (float)Math.Pow(10, -5), VOSP87.getPlanetVelocity("nep", 2458120, 0.5f).toVector(), VOSP87.getPlanetPosition("nep", 2458120).toVector(), Color.DarkBlue)
                //,new Body("Solar System Destroyer", 20f, new Vector(1.082f, -0.128f), new Vector(-60.06f, 15f), Color.OrangeRed)
                //,new Body("Solar System Destroyer2", 800f, new Vector(-3.082f, 2.128f), new Vector(60.06f, -25f), Color.OrangeRed)
            };

            i = new IntMethods.RungeKutta4(1, bds.Length);

            s = new BodySystem(bds);

            szx   = this.Width;
            szy   = this.Height;
            contx = BufferedGraphicsManager.Current;
            bg    = contx.Allocate(this.CreateGraphics(), new Rectangle(0, 0, szx, szy));

            timer1.Interval = 2;
            timer1.Start();
        }
Example #2
0
 public void simulateStep(float delta_t, IntegrationMethod i)
 {
     i.calculateAccelerations(bodies, delta_t);
     i.move(bodies, delta_t);
 }