Esempio n. 1
0
        public void OrbitSun(OrbitingObject satellite, double timeToOrbit)
        {
            var r = timeToOrbit / (Math.PI * 2d);
            var radians = Rand.Next()*Math.PI*2d;
            var delta = new Vector(Math.Cos(radians) * r, Math.Sin(radians) * r, 0);

            OrbitSun(satellite, delta);
        }
Esempio n. 2
0
        public void OrbitSun(OrbitingObject satellite, Vector initialPosition)
        {
            satellite.Location = this;
            this.satellites.Add(satellite);
            satellite.LocalCoordinates = initialPosition;

            this.satellites.Sort(SortByDistance);

            Extent = Math.Max(Extent, satellite.LocalCoordinates.Magnitude + satellite.Extent);
        }