malte-berg / sierpinski

Sierpiński triangle using Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sierpiński triangle using Python

This simple project was done to learn more about using the Turtle graphics class in Python. When running, the turtle places dots in different colors and forms the fractal known as the Sierpiński triangle.

Made with chaos

Taken from the Sierpiński triangle Wikipedia article

  1. Take three points in a plane to form a triangle.
  2. Randomly select any point inside the triangle and consider that your current position.
  3. Randomly select any one of the three vertex points.
  4. Move half the distance from your current position to the selected vertex.
  5. Plot the current position.
  6. Repeat from step 3.

About

Sierpiński triangle using Python


Languages

Language:Python 100.0%