Distance covered by a bouncing ball in a rectangle. So I was wondering based on a given number of bounces, what is the distance covered by a bouncing ball inside rectangle.
The factors I can give are:

*

*Angle of starting velocity

*Starting position (of course inside the rectangle)

*size of the box

*Number of bounces

I've thought of this in terms of series of lines, in terms of 'unravelling' the square into 2d space so the bounces just become intersections, but with no results.
My first question so please tell me if I missed something. Thank you.
 A: Suppose that the width $w$ and length $l$ are in rational proportion. That is, $r = \frac wl = \frac nm$ for some positive integers $m, n$, i.e., $nl = mw$. Also suppose that the slope of the initial line of travel of the ball is rational, say $s = \frac pq$ for integers $p, q > 0$ (if the original slope is negative, the picture can be flipped to make it positive).
If we "unravel" the path, we get instead a grid of $w \times l$ rectangles, and the path is now just a straight line. If the ball moves along that line from the starting point a distance of $qmw$ to the right, it will also move up by $pmw = pnl$. Because this is an exact multiple of the squares, the ball ends up in the same place it started, and heading in the same direction. So its future path is just repetitions of the path so far. The distance travelled per bounce will be the same for the entire path as for this first repetition.
For that first repetition, the distance travelled is $\sqrt{(qmw)^2 + (pmw)^2} = qmw \sqrt{1 + s^2}$. And the path crosses $qm + pn$ gridlines, or in the original view $qm + pn$ bounces (if the path intersects a vertex, that counts as a double-bounce). So the average distance per bounce is
$$\frac{qmw\sqrt{1+s^2}}{qm + pn} = w \frac{\sqrt{1 + s^2}}{1 + rs}$$
Treating that expression as a function of $s$, we see that it equals

*

*$w$ when $s = 0$

*$\frac wr = l$ when $s \to \infty$
as would be expected. Also, it has a critical point when $s = r$, where the average distance per bounce is $$\frac w{\sqrt{1 + r^2}} = \frac {wl}{\sqrt{w^2 + l^2}}$$
Because irrationals can be approximated by rationals to any desired accuracy, these three values will also be the limits more generally: The mean distance between bounces tends towards a value between the minimum and maximum values of $\left\{ w, l,\frac {wl}{\sqrt{w^2 + l^2}}\right\}$.
A: Note: Just enquiring via pic if I'm getting the question right? (Feel free to use this image in your question if it helps) 
Are the bounces taking place as such?

Or are they semicircular? 
Is there some loss of height to be considered too?
