title: Coding Bouncing Balls in Racket
body: <p>I'm trying to create a World in Racket where the World takes in a Listof Ball (Ball is a struct with a y-coordinate, velocity and elasticity) and creates a big-bang where those balls are bouncing within a window. The simulation will end when the balls have all stopped bouncing (y-coordinate = 0, velocity = 0).</p>
  
  <p>This is what I have so far...</p>
  
  <pre><code>(define-struct Ball
    ([y : Real] ;; position above ground of the center of ball in metres
     [v : Real] ;; velocity in m/s
     [e : Real] ;; between 0 and 1
     [r : Real] ;; radius in meters
     [c : Image-Color])) ;; colour of ball
  
  (define-type World (Listof Ball))
  </code></pre>
  
  <p>I am a bit lost as to what my first step should be; I'm not quite sure how the parameters of the velocity and elasticity would fit into the equation. In particular these are my concerns:</p>
  
  <p>1) How do we design a World that takes in a Listof</p>
  
  <p>2) How do I confine the bouncing of the balls to a definite window (aka how to ensure the ball won't bounce out of the defined window)</p>
  
  <p>Any ideas that can kickstart my efforts? :) Thanks in advance!</p>