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(→ None)

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

draw_fractal_recursive(→ None)

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

draw_vicsek_fractal(→ None)

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

main(→ None)

set_color(→ None)

Module Contents

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

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) None

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') None

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

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