ajnirp / stochastic_sierpinski

A stochastic method to generate an approximation to the Sierpinski triangle

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

A stochastic method to generate an approximation to the Sierpinski triangle


Languages

Language:JavaScript 100.0%