Solving a maze with rounded corners using laser beams
Channel: Nils Berglund
Date: 2022-12-21

This simulation shows laser beams reflected a maze in each corner of which a quarter-circle has been inserted. The question arose in the comments of a previous video, how this would change the behavior of the beams. The quarter-circles make the dynamics much more chaotic, since they allow each trajectory to take on more different directions than for a maze having only right angles. This appears to be less effective than adding wedges in the angles, as seen in the video https://youtu.be/z85cl0hiuiw , but way more effective than the randomizing the maze, as in the video https://youtu.be/H8MgMF32qRo
10000 laser beams, or particles with trails, are shot in all directions of a maze of size 32 by 32. The particles/beams are reflected by the walls of the maze, and keep going until they leave the maze on the left or right side. The color of each beam depends on its number of bounces on the walls, and cycles back after 250 bounces. The figures at the bottom show the number of particles that have left the maze to the left and to the right. 
The videos in this series are inspired by the Numberphile video https://youtu.be/BvwgdrC8vlE in which Matt Henderson shows "The Dumbest Way To Solve A Maze", by using particles that explore the maze at random. In Matt's simulations, the particles exploring the maze do not interact. They change direction at random, or whenever they approach a wall of the maze. This version involves no randomness: the motion is completely determined by the initial angle of the particle. 

Render time: 12 minutes 48 seconds
Color scheme:  Turbo, by Anton Mikhailov
https://gist.github.com/mikhailov-work/6a308c20e494d9e0ccc29036b28faa7a

Music: "Streamlinet" by EveningLand@EveninglandMusic

Current version of the C code used to make these animations: 
https://github.com/nilsberglund-orleans/YouTube-simulations
https://www.idpoisson.fr/berglund/software.html

Some outreach articles on mathematics:
https://images.math.cnrs.fr/_Berglund-Nils-1343_.html
(in French, some with a Spanish translation)