This is a simple program that calculate then draws pool fractals. It is written in Python. Pool Fractals are done by considering a ball bouncing at 90° on a pool table each time an edge is encountered. The pool table is divided in a grid (the input of the program and) and only half of the path is drawn. The ball always starts in a corner and end in another:
This program requires python 3 to be installed. Dependencies can be installed using pip:
pip install -r requirements.txt
python main.py
You are then asked to enter the size of the grid (the number of squares on each side). The program will then calculate the fractal and draw it in a window.
Different sizes of grid result in different patterns. Here are some examples:
Those 2 are generated using two consecutive number of the fibonacci sequence as the grid size (21, 13) and (144, 89). Both image result in the same pattern and the ratio between the two dimensions of the grid is an approximation of the golden ratio (1.61803398875) : 21/13 = 1,61538462 and 144/89 = 1,61797753.
When observing this pattern, it is possible to estimate pi using the dimension of the grid: 223/71 = 3,14084507 ~ piMore patterns can be obtained. Feel free to try out!
More information about pool fractals can be found here: http://xcont.com/