GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Python_Algorithms/fractals at master · ikko/Python_Algorithms

Expand file tree

/

fractals

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

fractals

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
README.md
README.md
 
 
__init__.py
__init__.py
 
 
barnsley_fern.py
barnsley_fern.py
 
 
hilbert_curve.py
hilbert_curve.py
 
 
julia_sets.py
julia_sets.py
 
 
koch_snowflake.py
koch_snowflake.py
 
 
mandelbrot.py
mandelbrot.py
 
 
sierpinski_carpet.py
sierpinski_carpet.py
 
 
sierpinski_triangle.py
sierpinski_triangle.py
 
 
vicsek.py
vicsek.py
 
 

README.md

Outline

Fractals

A fractal is a geometric figure that is self-similar: zooming into a piece of it reveals a copy of the whole. Fractals show up in mathematics, physics, computer graphics and even biology (coastlines, ferns, snowflakes).

This directory collects small, self-contained fractal generators. They fall into two groups:

  • Visual demos that open a window (via turtle) or produce an image (via matplotlib/PIL). Run these directly to see the picture.
  • Pure-computation generators whose output can be checked with doctest, so they run in CI without a display.

Contents

File Fractal Output Notes
barnsley_fern.py Barnsley fern matplotlib (optional) Iterated function system; deterministic with a seed
julia_sets.py Julia sets matplotlib Complex-plane escape-time fractal
koch_snowflake.py Koch snowflake matplotlib Line-segment subdivision
mandelbrot.py Mandelbrot set PIL image Complex-plane escape-time fractal
sierpinski_carpet.py Sierpinski carpet text Integer arithmetic, fully doctested
sierpinski_triangle.py Sierpinski triangle turtle Recursive midpoint subdivision
vicsek.py Vicsek fractal turtle Recursive cross pattern

Running

# text fractal – prints to the terminal
python fractals/sierpinski_carpet.py

# image fractal – opens a matplotlib window (needs matplotlib)
python fractals/barnsley_fern.py

# turtle fractal – opens a drawing window (needs a display)
python fractals/vicsek.py

Further reading

  • Benoit B. Mandelbrot, The Fractal Geometry of Nature (1982)
  • Michael Barnsley, Fractals Everywhere (1988)
  • https://en.wikipedia.org/wiki/Fractal
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.