GitHub - ajnirp/stochastic_sierpinski: A stochastic method to generate an approximation to the Sierpinski triangle

· GitHub

1 min read Original article ↗

Latest commit

History

6 Commits

Folders and files

NameName

Last commit message

Last commit date

Repository files navigation

About

A stochastic method to generate an approximation to the Sierpinski triangle. Made using p5.js.

Demo

Imgur link

Algorithm

  1. Pick a random point p inside the triangle (algorithm).
  2. Draw it.
  3. Pick a random vertex of the triangle and find its midpoint with p. Set p to that midpoint.
  4. Go to step 2.

Why it works

Not sure. Need to figure this one out.