In this Demonstration, parallel planes passing through the vertices of a regular polygon bound the media. The inradius of the polygon is 1. When you roll the polygon with the second slider, a particular vertex of the polygon moves along a path and passes through the boundary planes at the marked points. When a light ray follows these points, Snell's law is satisfied. You can see this by selecting "show angles". Call the angle between the ray and boundary plane after refraction θ. The angle between the normal to the ray and vertical direction is 2θ. The speed of light in a medium is proportional to the square root of the height difference between the midpoint of the path in this medium and the initial position of the particle. This...