# Sierpinksi Triangle

reset ||
view image to save ||
change colour

iterate ||
iterate x100 ||
iterate x10,000

## Instructions

Click 3 times to place a triangle (red dots). Clicking 1 more time will place the start point (a green dot).
Then by choosing from the "iterate..." links, you can perform iterations, see the algorithm below.

## Algorithm

- 1. Point P starts where it is placed (green dot).
- 2. Each iteration, a vertex of the triangle is chosen at random.
- 3. P is moved to half way between its current position and the chosen vertex.
- 4. Repeat steps 2 and 3.

This is an experiment using JavaScript and the HTML5 canvas element.