examples of fractals

Fractal Examples: Discover Nature's Patterns

By
AD

The mesmerizing world of fractals, infinite patterns created by repeating simple mathematical formulas, is an exciting fusion of mathematics, art, and even nature. Fractals exhibit a unique property known as self-similarity, where parts of a pattern resemble the whole at all levels of magnification. Let's delve into the fascinating realm of fractals, exploring various examples that showcase their dazzling diversity.

Fractals are encountered in numerous fields, from computer graphics to physics, and have fascinating applications in various industrial and scientific domains. Before we dive into specific examples, let's first discuss two fundamental types: Iterated Function Systems (IFS) and L-systems.

Iterated Function Systems (IFS)

IFS fractals are generated by repeatedly applying a set of mathematical functions to an initial starting point. The power of IFS lies in its simplicity, as even a basic set of functions can lead to complex, rich fractal patterns.

AD
Fractal Geometry
Fractal Geometry
an octopus laying on the ground with its tentacles curled up
an octopus laying on the ground with its tentacles curled up
26 Stunning Examples of Geometrical Symmetry Found in Nature
26 Stunning Examples of Geometrical Symmetry Found in Nature

One of the most well-known IFS fractals is the Sierpinski triangle, created by repeatedly removing triangles from an initial equilateral triangle. This process generates a fractal with self-similar, triangular structures at all levels of zoom.

Cantor Set

The Cantor Set is another prominent IFS fractal, where a initial line segment is repeatedly halved and the middle third removed. This iterative process results in an infinite fractal with a non-zero length but zero area, a paradoxical property that challenged early mathematicians.

Chapter 1 - FRACTALS IN NATURE
Chapter 1 - FRACTALS IN NATURE
a close up view of a red and white plant's leaf structure with thin lines
a close up view of a red and white plant's leaf structure with thin lines
a large green flower sitting on top of gravel
a large green flower sitting on top of gravel

Example code to generate a Cantor Set using Python:

def cantor(n):
    if n == 0:
        return ["1"]
    else:
        c = cantor(n - 1)
        return ['®'.join(p) for p in c] + ['®'.join(p) for p in c] + ['®'.join(p) for p in c]

print('\n'.join(cantor(3)))

Mandelbrot Set

The iconic Mandelbrot Set is an IFS fractal generated by iteration of a simple complex quadratic polynomial. Each point in the complex plane is tested for whether it's within the fractal or not, resulting in an intricate, coastline-like boundary that exhibits self-similarity at all levels of zoom.

AD

Example Python code using matplotlib to generate a basic Mandelbrot Set visualization:

an orange cat sleeping on top of a basketball court in the shape of a circle
an orange cat sleeping on top of a basketball court in the shape of a circle
Divine Geometry, Sacred Geometry Alchemy, Esther Bible Study, Shadow Work Spiritual, Witchcraft Symbols, Fractal Geometry, Esoteric Symbols, Ancient Writing, Makeup Drawing
Divine Geometry, Sacred Geometry Alchemy, Esther Bible Study, Shadow Work Spiritual, Witchcraft Symbols, Fractal Geometry, Esoteric Symbols, Ancient Writing, Makeup Drawing
the different types of trees that can be seen in this image are shown on white paper
the different types of trees that can be seen in this image are shown on white paper
an art piece made out of wire and glass with a spiral design on it's surface
an art piece made out of wire and glass with a spiral design on it's surface
an intricately designed piece of art is shown in this image, it appears to be made out of paper
an intricately designed piece of art is shown in this image, it appears to be made out of paper
Fiery Fractal Design, Fractal Design Purple And Orange, Vibrant Orange Fractal Design, Fractal Fire Pattern, Fiery Fractal Pattern, Fractal Pattern With Orange Background, Red And Yellow Fractal Design, Red And Orange Fractal Pattern, Abstract Fiery Fractal Pattern
Fiery Fractal Design, Fractal Design Purple And Orange, Vibrant Orange Fractal Design, Fractal Fire Pattern, Fiery Fractal Pattern, Fractal Pattern With Orange Background, Red And Yellow Fractal Design, Red And Orange Fractal Pattern, Abstract Fiery Fractal Pattern
import matplotlib.pyplot as plt
import numpy as np

def mandelbrot(c, max_iter):
    z = c
    for n in range(max_iter):
        if abs(z) > 2:
            return n
        z = z*z + c
    return max_iter

x = np.linspace(-2, 1, 600)
y = np.linspace(-1.5, 1.5, 600)
X, Y = np.meshgrid(x, y)
C = X + 1j*Y
Z = mandelbrot(C, 256)
plt.imshow(Z, extent=(x[0], x[-1], y[0], y[-1]), cmap='magma')
plt.show()

L-systems

Introduced by Aristid Lindenmayer in 1968, L-systems are a type of formal grammar used for generating fractals. Unlike IFS fractals, L-system fractals typically represent the development of plant and tree structures, based on iterative replacement of initial symbols according to a set of rules.

Dragon Curve

The Dragon Curve is an L-system fractal generated by repeatedly applying a set of rules to an initial starting string. Starting with an 'F', the curve grows by iteratively replacing 'S' with 'F+XF+F+XF', and 'F' with '+F-XF-FX+'. This simple rule set produces a remarkably complex, self-similar curve that resembles a dragon.

AD

Example JavaScript code to generate a Dragon Curve using p5.js library:

many blue succulents are arranged together
many blue succulents are arranged together
Fractal Geometry
Fractal Geometry
a purple cabbage sitting on top of a cutting board
a purple cabbage sitting on top of a cutting board
🎨 30 Stunning Examples of Algorithmic Fractal Art Design
🎨 30 Stunning Examples of Algorithmic Fractal Art Design
let angle = 0.5 * PI;
let myRules = { 'X': 'F+XF+F downstairs F+X F', 'F': '+F-XF-FX+Fireworks' };

function setup() {
  createCanvas(640, 640);
  noLoop();
}

function draw() {
  background(255);
  drawDragonCurve('X', 10, height / 2, angle.pi / 3);
}

function drawDragonCurve(axiom, x, y, angle) {
  let currentInstruction = axiom;
  for (let i = 0; i < 15; i++) {
    currentInstruction = replaceInstruction(currentInstruction, myRules);
  }
  let len = 8;
  let i = 0;
  while (i < currentInstruction.length) {
    let instruction = currentInstruction[i];
    if (instruction == 'F') {
      line(x, y, x + len * cos(angle), y + len * sin(angle));
      x += len * cos(angle);
      y += len * sin(angle);
    } else if (instruction == '+') {
      angle += PI / 3;
    } else if (instruction == '-') {
      angle -= PI / 3;
    }
    i++;
  }
}

function replaceInstruction(s, dict) {
  return s.replace(/[FX]/g, function(key) { return dict[key]; });
}

Fractals permeate the natural world, reflecting the same mathematical principles that generate these stunning patterns. From the branching of trees to the crumpling of paper, fractals offer a fascinating window into the intersection of mathematics, nature, and art. Exploring fractals is not just an engaging visual journey but also a doorway into the captivating world of complex systems and their mathematical underpinnings.

AD