Investigating Multiple Reflections of a Laser Beam
A laser beam enters a white cell (an ellipse defined by 4x^2 + y^2 = 100) at the point (0, 10.1) and first hits the mirror at (1.4, -9.6). Each time the beam hits the surface, it is reflected accor...
Problem Statement
This archive keeps the full statement, math, and original media on the page.
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 $4x^2 + y^2 = 100$.
The section corresponding to $-0.01 \le x \le +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)$.
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/y$.
The 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?
Problem 144: Investigating Multiple Reflections of a Laser Beam
Mathematical Foundation
Theorem 1. For the ellipse , the outward unit normal at a point on the ellipse is proportional to .
Proof. The ellipse is the level set . The gradient is perpendicular to the level curve and points outward. Simplifying by the common factor of 2:
This is outward-pointing because for a point on the ellipse with , the -component is positive (pointing away from the center).
Theorem 2 (Reflection Formula). Given an incoming direction and surface normal , the reflected direction is:
Proof. Decompose where is the component along and is tangential. The law of reflection reverses the normal component while preserving the tangential component:
Theorem 3 (Ray—Ellipse Intersection). A ray from on the ellipse in direction intersects the ellipse again at parameter:
Proof. Substitute into :
Expanding and using :
The solution corresponds to the starting point. The other solution is:
Lemma 1. The parameter in Theorem 3 is always nonzero (unless the ray is tangent to the ellipse at the starting point), so the ray always hits the ellipse again.
Proof. The numerator vanishes only when is tangent to the ellipse at . After reflection, has a nonzero normal component (since the incoming ray was not tangent), so the numerator is nonzero.
Editorial
Simulate laser reflections inside the ellipse 4x^2 + y^2 = 100. Entry at (0, 10.1), first hit at (1.4, -9.6). Exit when |x| <= 0.01 at the top (y > 0). We repeat. We then reflect. Finally, next intersection.
Pseudocode
INPUT: Ellipse 4x^2 + y^2 = 100, entry (0, 10.1), first hit (1.4, -9.6)
OUTPUT: Number of internal reflections before exit
repeat
Reflect
Next intersection
Check exit
Complexity Analysis
- Time: where is the number of reflections. Each reflection requires arithmetic operations (dot product, reflection, quadratic solve). Here .
- Space: — only the current position, direction, and normal need to be stored.
Answer
Code
Each problem page includes the exact C++ and Python source files from the local archive.
#include <bits/stdc++.h>
using namespace std;
int main() {
// Problem 144: Laser reflections in ellipse 4x^2 + y^2 = 100
// Entry: (0, 10.1) -> first hit: (1.4, -9.6)
// Exit: |x| <= 0.01 at top (y > 0)
double x0 = 0.0, y0 = 10.1;
double x1 = 1.4, y1 = -9.6;
int count = 0;
while (true) {
// Direction of incoming beam
double dx = x1 - x0;
double dy = y1 - y0;
// Normal at (x1, y1): proportional to (4*x1, y1)
double nx = 4.0 * x1;
double ny = y1;
// Reflect: d' = d - 2*(d.n)/(n.n) * n
double dn = dx * nx + dy * ny;
double nn = nx * nx + ny * ny;
double rx = dx - 2.0 * dn / nn * nx;
double ry = dy - 2.0 * dn / nn * ny;
// Find next intersection with 4x^2 + y^2 = 100
// Ray: (x1 + t*rx, y1 + t*ry)
// 4(x1+t*rx)^2 + (y1+t*ry)^2 = 100
// t * (4*rx^2 + ry^2) + 2*(4*x1*rx + y1*ry) = 0 (dividing out t=0)
double denom = 4.0 * rx * rx + ry * ry;
double t = -2.0 * (4.0 * x1 * rx + y1 * ry) / denom;
double x2 = x1 + t * rx;
double y2 = y1 + t * ry;
count++;
// Check exit condition
if (fabs(x2) <= 0.01 && y2 > 0) {
break;
}
x0 = x1; y0 = y1;
x1 = x2; y1 = y2;
}
cout << count << endl;
return 0;
}
"""
Problem 144: Investigating Multiple Reflections of a Laser Beam
Simulate laser reflections inside the ellipse 4x^2 + y^2 = 100.
Entry at (0, 10.1), first hit at (1.4, -9.6).
Exit when |x| <= 0.01 at the top (y > 0).
"""
def solve():
x0, y0 = 0.0, 10.1
x1, y1 = 1.4, -9.6
count = 0
points = [(x0, y0), (x1, y1)]
while True:
# Incoming direction
dx = x1 - x0
dy = y1 - y0
# Normal at (x1, y1) on ellipse 4x^2 + y^2 = 100
nx = 4.0 * x1
ny = y1
# Reflect: d' = d - 2(d.n)/(n.n) * n
dn = dx * nx + dy * ny
nn = nx * nx + ny * ny
rx = dx - 2.0 * dn / nn * nx
ry = dy - 2.0 * dn / nn * ny
# Next intersection parameter
denom = 4.0 * rx * rx + ry * ry
t = -2.0 * (4.0 * x1 * rx + y1 * ry) / denom
x2 = x1 + t * rx
y2 = y1 + t * ry
count += 1
points.append((x2, y2))
# Exit check
if abs(x2) <= 0.01 and y2 > 0:
break
x0, y0 = x1, y1
x1, y1 = x2, y2
print(count)

