Problem 144 of Project Euler is once again a geometry problem, just like the previous. However, it is completely different. The problem reads

**In laser physics, a “white cell” is a mirror system that acts as a delay line for the laser beam. The beam enters the cell, bounces around on the mirrors, and eventually works its way back out.**

**The specific white cell we will be considering is an ellipse with the equation 4×2 + y2 = 100**

**The section corresponding to -0.01 ≤ x ≤ +0.01 at the top is missing, allowing the light to enter and exit through the hole.**

**The light beam in this problem starts at the point (0.0,10.1) just outside the white cell, and the beam first impacts the mirror at (1.4,-9.6).**

**How many times does the beam hit the internal surface of the white cell before exiting?**

We will simply brute force our way through this problem, by calculating the laser beams path through the cell, and check if it hits the exit. In order to do that, we need to calculate how the laserbeam reflects. Once we know the angle of the reflecting beam, we can calculate the corresponding line, since we have the point of reflection. Once we have a line parameterization of the reflecting line, it is simply a matter of finding out where the line and the ellipse intersect. This will be the next point out laser beam hits. Confused yet? Don’t be. I will elaborate on it. Lets start by finding the slope of the reflecting beam.

12 Comments

Project Euler