To determine how the position of the ball relates to the velocity vector, note that the height of the ball at a collision is related to the previous height at the opposite wall by
To determine how the position of the ball relates to thevelocity vector, note that the height of the ball at a collisionis related to the previous height at the opposite wall by