Skip to main content

Section 4.7 More examples

In this section, we'll the tools we've developed to generate a few more interesting examples of self-similar sets. As the examples get more complicated, we'll find that we need refinements in our techniques to generate them.

Subsection 4.7.1 Generalized Sierpinski triangles

Any three, non-collinear points in the plane determine a triangle. If we generate an iterated function system using contractions about those points with the contraction ratio \(1/2\text{,}\) we generate a Sierpinski like construction based on the resulting triangle.

We can generate three random points and the corresponding generailized Sierpinski triangle on Observable like so:

new IteratedFunctionSystem(
  d3.range(3)
    .map(() => scale(1 / 2, [d3.randomUniform()(), d3.randomUniform()()]))
).render_stochastic({ colors: true })

The resulting looks a lot like FigureĀ 4.7.1. Full code can be found in this Observable notebook: https://observablehq.com/@mcmcclur/generalized-sierpinski-triangles

Figure 4.7.1. A generalized Sierpinski triangle

Subsection 4.7.2 The Sierpinski Carpet

The Sierpinski carpet consists of 8 copies itself scaled by the factor \(1/3\text{.}\) The IFS can be expressed used the following code:

let vertices = [
  [-1, -1], [0, -1], [1, -1], [1, 0],
  [1, 1], [0, 1], [-1, 1], [-1, 0]];
let carpetIFS = new IteratedFunctionSystem(
  vertices.map((pt) => scale(1 / 3, pt)));

An approximation to the set is shown in FigureĀ 4.7.2 basd on code here: https://observablehq.com/@mcmcclur/iterated-function-systems#cell-510

Figure 4.7.2. The Sierpinski carpet

Subsection 4.7.3 The Koch curve

Subsection 4.7.4 The Z-curve

Subsection 4.7.5 The Sierpinski pedal triangle

Subsection 4.7.6 The Z-curve

Subsection 4.7.7 The Koch snowflake

Subsection 4.7.8 The twindragon