# Reflecting a vector within a box (variation on the billiards problem)

Let there be a box, with bottom left corner at (0,0), and top right corner being at (m,n), where m and n are positive integers.

A starting point is chosen at random within the box at (x,y), such that 0 < x < m, and 0 < y < n.

From the starting point, create a vector with integer components. Once the vector hits a side of the box, it will reflect off the side, similar to the billiards problem, but not necessarily at a 45 degree angle.

Question:

Provided that the vector will continue reflecting in the box for a very long, but finite time (say, 10,000 units), for a given vector, I want to determine

1) whether the vector will eventually hit a corner.

2) whether the vector will eventually hit the starting point.

• "A starting point is chosen at random within the box at (x,y), such that 0" What does this mean? Aug 11, 2018 at 7:50
• Welcome to MSE. It will be more likely that you will get an answer if you show us that you made an effort. This should be added to the question rather than in the comments. Aug 11, 2018 at 7:53
• As usual with problems of this type, unfold the path into a straight line by tiling the plane with reflections of the box and starting point.
– amd
Aug 11, 2018 at 9:20

Let ${\bf v}=(p,q)$ be the initial velocity. Consider the huge number $N:={\rm lcm}(m,n,p,q)$.