2.0 KiB
id | challengeType | title |
---|---|---|
5900f3fc1000cf542c50ff0f | 5 | Problem 144: Investigating multiple reflections of a laser beam |
Description
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). Each time the laser beam hits the surface of the ellipse, it follows the usual law of reflection "angle of incidence equals angle of reflection." That is, both the incident and reflected beams make the same angle with the normal line at the point of incidence. In the figure on the left, the red line shows the first two points of contact between the laser beam and the wall of the white cell; the blue line shows the line tangent to the ellipse at the point of incidence of the first bounce.The slope m of the tangent line at any point (x,y) of the given ellipse is: m = −4x/yThe normal line is perpendicular to this tangent line at the point of incidence. The animation on the right shows the first 10 reflections of the beam.
How many times does the beam hit the internal surface of the white cell before exiting?
Instructions
Tests
tests:
- text: <code>euler144()</code> should return 354.
testString: assert.strictEqual(euler144(), 354, '<code>euler144()</code> should return 354.');
Challenge Seed
function euler144() {
// Good luck!
return true;
}
euler144();
Solution
// solution required