# Reflections in regular polygons

I was thinking about regular polygons and paths beginning at a vertex such that whenever the path hits a side, it has a mirror reflection (angle of incidence equalling the angle of reflection) and continues on, undergoing a mirror reflection whenever it hits a side until it hits a vertex and the path ends.

If the polygon is a unit square, $ABCD$, let the path begin at $A$. WLOG, let the first side it hits be $BC$ and let $E$ be the point of intersection. I figured out that if $BE$ is $\frac{a}{b}$, where $\frac{a}{b}$ is rational and $a,b$ are co-prime, then the path will terminate. I realized that within the cartesian plane, the path described is the same as the path traveled from $(0,0)$ to $(a,b)$ so I can actually figure out the number of reflections during the path, the length of the path and the vertex where it ends (by labeling the lattice points based on reflections of the unit square).

Similarly, I realized I can do the same if the polygon is a unit equilateral triangle, $ABC$. Let $A$ (the origin) be the initial starting point and $E$ is the point on $BC$ that the path initially hits, where $BE$ is $\frac{a}{b}$. I can have a tessellation of the plane with unit equilateral triangles and we can consider a large equilateral triangle, $AB'C'$ of side $a+b$. Then the path described is that same as the path from $A$ to $X$, where $X$ is on $B'C'$ such that $B'X$ is $a$. Again, we can ascertain the length of the path, the number of reflections and the vertex where it ends.

My question is how would one approach this problem for a regular pentagon or heptagon, or any regular polygon that you cannot tessellate the plane with.

In the case of the hexagon, I know that I can tesselate the plane with hexagons but am unsure of how to describe the path in terms of a straight line in terms of $a$ and $b$ and unsure of how to determine the final vertex since different reflections produce different vertices (for example, suppose we reflect the hexagon over $BC$ and over $CD$. Then the image of $B$ is the same as the image of $D$).