/// <summary> /// Initializes a particle with a random position and velocity. /// The position is uniform in the unit box; the velocity in /// either direciton is chosen uniformly at random. Member initializers /// will replace these random values.</summary> /// <param name="target">the drawing target</param> public Particle(DrawingWindow target) : base(target) { X = StdRandom.Uniform(0.0, 1.0); Y = StdRandom.Uniform(0.0, 1.0); Vx = StdRandom.Uniform(-.005, 0.005); Vy = StdRandom.Uniform(-.005, 0.005); Radius = 0.01; Mass = 0.5; color = Colors.Black; }
/// <summary> /// Derived classes have to call to initiaze the drawing window /// </summary> /// <param name="target">the drawing window</param> public BasicVisual(DrawingWindow target) { Debug.Assert(target != null); _target = target; }