Can complete randomness produce perfect geometric order? Define three vertices of an equilateral triangle: $(0, 150)$, $(-150, -100)$, and $(150, -100)$. Start a point $(x, y)$ at $(0, 0)$. In a loop of $5{,}000$ steps:What famous fractal shape emerges on the screen?
- Randomly pick one of the three vertices using math.random(1, 3).
- Move $(x, y)$ halfway toward that vertex: $x = (x + x_v)/2$ and $y = (y + y_v)/2$.
- Plot the point using pset(x, y).
See your results here: