Suppose I have a rectangular table, dimensions $x$ by $y$, and a billiard ball is positioned in the very center. For descriptive convenience, let us impose a coordinate system on this table with an origin (0,0) in the center of the table where I strike the ball.
Now say I strike the ball at an angle of $\theta$ with respect to the horizontal. If the ball moves forever after being struck, for what values of $\theta$ will the ball form a closed loop and eventually return to initial conditions and retrace its own path all over again, and for what value of $\theta$ will the ball not form a closed loop and never re-trace its own path?