Distance travelled and exit point between two parallel mirrors in 3D

71 Views Asked by At

I'm the author of open-source optical ray-tracing software. One very common problem is light bouncing between two parallel mirrors. Currently, this is very slow because I follow each ray at each bounce until it exits (i.e. point $E$ in the diagram below).

I'm trying to find an expression which lets me calculate the exit point,

$$E = (x, y, z)$$

and ray direction at the exit point,

$$\lambda = (a, b, c)$$

For example, see the diagram below is a simplification of the problem to 2D. I'm actually trying to find a full 3D solution for arbitrary length ($L$), width ($W$) and height ($H$), starting point ($A$) and first bounce point ($B$). All of these quantities are known. Unknowns are all other bounce points.

I have solved this iteratively, by calculating all the other bounce points by moving one step along and flipping the direction vector each time. I was hoping to gain some mathematical insight into this problem in 3D to see if there is an expression which does not require iteration.

One useful piece of information is that $\tau$, the full pathlength, is the same in the black and red line (plus distance AB).

2D simplification of problem