Skip to content

DenisD3D/PoolFractalsDrawer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pool Fractals Drawer

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:

10x9

How to use

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.

Examples

Different sizes of grid result in different patterns. Here are some examples:

21x13 144x89

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.

223x71

When observing this pattern, it is possible to estimate pi using the dimension of the grid: 223/71 = 3,14084507 ~ pi

More patterns can be obtained. Feel free to try out!

References

More information about pool fractals can be found here: http://xcont.com/

About

Generate patterns created by a bouncing pool ball

Resources

Stars

Watchers

Forks

Languages