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); }
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); }
public BodyObject Copy() { var res = new BodyObject(Location.Copy(), Mass, Velocity.Copy(), Name); return(res); }
public TwoBodies(BodyObject a, BodyObject b) { A = a; B = b; }