Example #1
0
        public static BodyObject[] CopyObjectList(BodyObject[] l)
        {
            var res = new BodyObject[l.Length];

            for (int i = 0; i < l.Length; i++)
            {
                res[i] = l[i].Copy();
            }
            return(res);
        }
Example #2
0
        public static BodyObject[] bodyObjectList(int i)
        {
            var    ls  = new BodyObject[i];
            Random rnd = new Random();

            for (int j = 0; j < i; j++)
            {
                ls[j] = new BodyObject(new Vector(rnd.Next(-250, 250), rnd.Next(-250, 250)), (double)rnd.Next(5, 100) * 100000000.0, new Vector(rnd.NextDouble() - 0.5, rnd.NextDouble() - 0.5));
            }
            return(ls);
        }
Example #3
0
        public BodyObject Copy()
        {
            var res = new BodyObject(Location.Copy(), Mass, Velocity.Copy(), Name);

            return(res);
        }
Example #4
0
 public TwoBodies(BodyObject a, BodyObject b)
 {
     A = a;
     B = b;
 }