Number of bounces by an object in a unit square with velocity $\vec{(p,q)}$, where p and q are co-prime. Please bear with me.

Imagine the unit square in the plane to be a carrom board. Assume the striker is just
a point, moving with no friction (so it goes forever), and that when it hits an edge, the
angle of reflection is equal to the angle of incidence, as in real life. If the striker ever
hits a corner it falls into the pocket and disappears. The trajectory of the striker is
completely determined by its starting point (x, y) and its initial velocity $$\vec{(p, q)}$$.
If the striker eventually returns to its initial state (i.e. initial position and initial velocity),
we define its bounce number to be the number of edges it hits before returning to its initial
state for the first time.
For example, the traectory with initial state $$[(.5, .5);\vec{(1, 0)}]$$ has bounce number 2 and
it returns to its initial state for the first time in 2 time units. And the trajectory with
initial state $$[(.25, .75); \vec{(1, 1)}] $$has bounce number 4.

(a) Suppose the striker has initial state $[(.5, .5);\vec{(p, q)}]$. If p > q ≥ 0 then what is the
velocity after it hits an edge for the first time? What if q > p ≥ 0?

(b) Draw a trajectory with bounce number 5 or justify why it is impossible.

(c) Consider the trajectory with initial state $[(x, y); \vec{(p, 0)}]$ where p is a positive integer.
In how much time will the striker first return to its initial state? 

(d) What is the bounce number for the initial state  $[(x, y);\vec{
(p, q)}]$   where p, q are relatively
prime positive integers, assuming the striker never hits a corner?

I have done (a), (b) and (c) and am stuck on (d).

Answer to (a) is $\vec{(-p,q)}$ and $\vec{(p,-q)}$.

Answer to (c) is $$\frac{2}{p}$$

Can you please tell me how to do it?

Thanks.
The usual way to do this sort of problem is using images.  For example, here we have a straight line from the centre of one lattice cell to another crossing $5$ edges.



This corresponds to a trajectory that goes from the centre of your square to itself after $5$ reflections.
The usual way to do this sort of problem is using images.  For example, here we have a straight line from the centre of one lattice cell to another crossing $5$ edges.



This corresponds to a trajectory that goes from the centre of your square to itself after $5$ reflections.