I was thinking when about to watch a movie the other day about the logo that one often sees, saying something such as "Sony Home Video", moving in lines around the screen and bouncing at the boundaries. It is a humorous but surprisingly entertaining thing to watch it move and see if it ever hits the corner exactly.
Naturally (at least, for a recreational mathematics enthusiast), the question arose: Given the dimensions of a rectangle and the coordinates of a point inside the rectangle, along with a direction of travel for that point, creating a path where the point, on reaching a side of the rectangle bounces of off it like a light beam, can you create a method of determining whether (given infinite time) the path eventually hits one of the corners exactly?
Equally, and perhaps more interestingly, can you display a construction of a set of initial conditions for a path (for any rectangle) that is not periodic (i.e. if it hits a specific point on the boundary of the rectangle, that point never appears in its path again)?
EDIT: In light of @dtldarek's observation, it has become clear that if $x_0, y_0$ are the initial coordinates of the point $p$ in the rectangle with gradient $g\in\mathbb{R}$ in the rectangle with sidelengths $s_0, s_1\in\mathbb{R}$, then the path eventually hits a corner if and only if $\exists n, m \in \mathbb{N}$ and $k\in\mathbb{R}$ such that $$kg+(x_0,y_0) = \frac{ns_0}{ms_1}$$
For a rectangle with sides $a$ and $b$ create a rectangular grid with the same ratio. Then, if you draw an infinite line, then its path is exactly the path of bouncing path only that some of the rectangle you pass are reflected.
In other words, the bouncing path hits a corner if and only if the infinite straight line hits a grid-point.
I hope this helps $\ddot\smile$
Edit: I still need to think about periodicity.