fractals.vicsek

Authors Bastien Capiaux & Mehdi Oudghiri

The Vicsek fractal algorithm is a recursive algorithm that creates a pattern known as the Vicsek fractal or the Vicsek square. It is based on the concept of self-similarity, where the pattern at each level of recursion resembles the overall pattern. The algorithm involves dividing a square into 9 equal smaller squares, removing the center square, and then repeating this process on the remaining 8 squares. This results in a pattern that exhibits self-similarity and has a square-shaped outline with smaller squares within it.

Source: https://en.wikipedia.org/wiki/Vicsek_fractal

Functions

draw_cross(x, y, length)

Draw a cross at the specified position and with the specified length.

draw_fractal_recursive(x, y, length, depth)

Recursively draw the Vicsek fractal at the specified position, with the

draw_vicsek_fractal(x, y, length, depth[, color])

Draw the Vicsek fractal at the specified position, with the specified

main()

set_color(rgb)

Module Contents

fractals.vicsek.draw_cross(x: float, y: float, length: float)

Draw a cross at the specified position and with the specified length.

fractals.vicsek.draw_fractal_recursive(x: float, y: float, length: float, depth: float)

Recursively draw the Vicsek fractal at the specified position, with the specified length and depth.

fractals.vicsek.draw_vicsek_fractal(x: float, y: float, length: float, depth: float, color='blue')

Draw the Vicsek fractal at the specified position, with the specified length and depth.

fractals.vicsek.main()
fractals.vicsek.set_color(rgb: str)