Skip to content

vladyslav-keidaliuk/fractal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Fractal

A simple fractal in 100 lines of code

This fractal is built according to a simple rule:

It starts with the first largest circle. Then each iteration 4 circles (top, left, right, bottom) with radius 2 times less than the previous one are pulled up to the biggest circle. Each iteration will produce a total of 2^n circles (n is pair power). Also, with each iteration, the line thickness changes.

Consider stepwise iterations (e.g., initial circle radius is 150 px and number of iterations = 4): 1: 1 circle with radius 150 px 2: 4 circles with radius 75 px 3: 16 circles with a radius of 37.5 px 4: 64 circles with a radius of 18.75 px.

In total we will have : 2^0 + 2^2 + 2^4 + 2^6 = 85 circles on the canvas.

image Number of iteration = 6, line thickness = 10;

image Number of iteration = 5, line thickness = 30;

About

A simple fractal in 100 lines of code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages