# Iterated Function Systems

## Sierpinski Triangle Generation

Begin by clicking any where inside the triangle to choose a starting point. At each iteration, a random number is generated between 1 and 3. The next point is found by plotting the point halfway between the current point and the vertex of the triangle labeled with the randomly chosen value.

Vertex 1: Chosen 0 times (0%)
Vertex 2: Chosen 0 times (0%)
Vertex 3: Chosen 0 times (0%)

## Barnsley's Fern

Begin with initial point $$(x_0,y_0) = (0,0)$$. At each iteration, find the next point by randomly selecting one of the four affine transformations below, weighted by the given probabilities:
 Transformation Probability $$\begin{bmatrix} x_{i+1}\\y_{i+1} \end{bmatrix} = \begin{bmatrix} 0.00 & 0.00 \\ 0.00 & 0.16 \end{bmatrix}\begin{bmatrix} x_i\\y_i \end{bmatrix}$$ 0.01 $$\begin{bmatrix} x_{i+1}\\y_{i+1} \end{bmatrix} = \begin{bmatrix} 0.85 & 0.04 \\ -0.04 & 0.85 \end{bmatrix}\begin{bmatrix} x_i\\y_i \end{bmatrix}+\begin{bmatrix} 0.00\\1.60 \end{bmatrix}$$ 0.85 $$\begin{bmatrix} x_{i+1}\\y_{i+1} \end{bmatrix} = \begin{bmatrix} 0.20 & -0.26 \\ 0.23 & 0.22 \end{bmatrix}\begin{bmatrix} x_i\\y_i \end{bmatrix}+\begin{bmatrix} 0.00\\1.60 \end{bmatrix}$$ 0.07 $$\begin{bmatrix} x_{i+1}\\y_{i+1} \end{bmatrix} = \begin{bmatrix} -0.15 & 0.28 \\ 0.26 & 0.24 \end{bmatrix}\begin{bmatrix} x_i\\y_i \end{bmatrix}+\begin{bmatrix} 0.00\\0.44 \end{bmatrix}$$ 0.07
That is, the first transformation is chosen 1% of the time, the second is chosen 85% of the time, and the last two are each chosen 7% of the time.

Transform 1: Chosen 0 times (0%)
Transform 2: Chosen 0 times (0%)
Transform 3: Chosen 0 times (0%)
Transform 4: Chosen 0 times (0%)

## Restricted Chaos Game

Begin by clicking any where inside the $$n$$-gon to choose a starting point. At each iteration, a random number is generated between 1 and $$n$$. The next point is found by plotting the point halfway between the current point and the vertex of the $$n$$-gon labeled with the randomly chosen value.

$$n$$ =
No Restriction
Next vertex cannot be current vertex
Next vertex cannot be place from current vertex

CAUTION! Wait until the drawing is updated before clicking on a button again; the 5000 step button can take a moment.