-
Notifications
You must be signed in to change notification settings - Fork 0
Fractal Types and Equations
"The beauty of fractals is that the infinite complexity is born from simple rules."
The Fractal Generator module provides a high-performance rendering engine for six classic fractal types, each representing a different facet of fractal mathematics. From the iconic Mandelbrot set to the organic beauty of the Barnsley Fern, these fractals demonstrate how simple iterative rules create infinite complexity.
This curated collection represents the breadth of fractal mathematics:
- Complex Dynamics (Mandelbrot, Julia, Burning Ship) - Iteration in the complex plane
- Computational Basins (Newton) - Numerical method visualization
- Iterated Function Systems (Barnsley Fern) - Probabilistic transformations
- Recursive Geometry (Sierpiński Triangle) - Self-similar construction
Together, they provide both educational value and practical applications in algorithm testing, visualization research, and computational art.
The Mandelbrot set is arguably the most famous fractal in mathematics. Discovered by Benoit Mandelbrot in 1980, it represents the set of complex numbers
Iteration Formula:
where:
-
$z_0 = 0$ (initial value) -
$c$ is the complex coordinate being tested -
$p$ is the power (typically 2, adjustable in the workspace)
Set Membership:
A point
- Boundary Complexity: The boundary has infinite detail at all scales
- Self-Similarity: Miniature copies of the set appear throughout the structure
- Fractal Dimension: Approximately 2.0 for the set itself; the boundary dimension is debated
- Color Mapping: Colors represent escape time (iterations until divergence)
- Power (p): 2-10 (higher powers create more radial symmetry)
- Max Iterations: 100-10000 (controls detail level)
- Resolution: 500×500 to 3840×2160 (4K)
- Color Scheme: 12 options including rainbow, grayscale, thermal, ocean
- Algorithm Testing: Benchmark for arbitrary-precision arithmetic
- Parallel Computing: Ideal for GPU acceleration studies
- Educational Demonstrations: Illustrate limits, convergence, complex numbers
- Computational Art: Publication-quality mathematical visualization
The Julia set is intimately related to the Mandelbrot set. While the Mandelbrot set varies the constant
Iteration Formula:
where:
-
$z_0$ is the complex coordinate being tested (varies) -
$c$ is a fixed complex constant (parameter) -
$p$ is the power (typically 2)
Set Membership:
A point
- Connected vs. Disconnected: Julia sets are either connected or dust-like (Cantor set)
-
Connection Criterion: Connected if and only if
$c$ is in the Mandelbrot set -
Symmetry: Julia sets exhibit rotational symmetry of order
$p$ -
Variety: Infinite variations based on
$c$ parameter
- Real Part of c: -2.0 to 2.0
- Imaginary Part of c: -2.0 to 2.0
- Power (p): 2-10
- Max Iterations: 100-10000
-
Recommended Values:
-
$c = -0.7 + 0.27i$ (classic seahorse valley) -
$c = -0.4 + 0.6i$ (dendritic structure) -
$c = 0.285 + 0.01i$ (Siegel disk)
-
- Parameter Space Exploration: Study bifurcations and chaos
- Dynamical Systems Theory: Visualize basins of attraction
- Art and Design: Generate unique, parametric artwork
- Education: Demonstrate impact of parameter variation
Discovered by Michael Michelitsch and Otto Rössler in 1992, the Burning Ship fractal is a variation of the Mandelbrot set that applies absolute value to the real and imaginary components at each iteration. This seemingly simple change produces dramatically different visual structures, including formations resembling ships on fire.
Iteration Formula:
where:
-
$\Re(z_n)$ is the real part of$z_n$ -
$\Im(z_n)$ is the imaginary part of$z_n$ -
$c$ is the complex coordinate being tested $z_0 = 0$
- Asymmetry: Unlike Mandelbrot, lacks symmetry about the real axis
- Ship-like Structures: Characteristic formations resembling burning vessels
- Fractal Dimension: Boundary complexity comparable to Mandelbrot
- Color Patterns: Often rendered with warm colors (fire themes)
- Max Iterations: 100-10000
- Resolution: Up to 4K
- Color Schemes: Thermal and fire palettes particularly effective
- Zoom Regions: Explore "ships" and "smoke plumes"
- Chaos Theory Research: Study non-symmetric chaotic systems
- Visual Art: Unique aesthetic distinct from Mandelbrot
- Algorithm Development: Test handling of absolute value operations
- Educational Contrast: Compare with Mandelbrot to show impact of small rule changes
Newton fractals visualize the basins of attraction for Newton's method applied to finding roots of polynomial equations. Each pixel is colored according to which root the iterative process converges to when started at that point in the complex plane. The boundaries between basins reveal fractal structures.
Newton's Method Iteration:
Default Polynomial: $$ f(z) = z^3 - 1 $$
Roots:
Derivative: $$ f'(z) = 3z^2 $$
-
Three-fold Symmetry: For
$z^3 - 1$ , rotational symmetry of 120° - Basin Boundaries: Fractal boundaries between convergence regions
- Color Coding: Each root assigned a different color
- Iteration Shading: Darker/lighter based on convergence speed
-
Polynomial Degree: Implicitly 3 (extendable to
$z^n - 1$ ) - Max Iterations: 50-500 (convergence is typically fast)
- Tolerance: Convergence threshold (default: 0.001)
- Resolution: Up to 4K for detailed basin boundaries
- Numerical Analysis: Visualize Newton's method behavior
- Computational Mathematics: Study convergence properties
- Complex Analysis Education: Illustrate polynomial roots
- Algorithm Benchmarking: Test numerical precision and stability
Created by British mathematician Michael Barnsley in 1988, the Barnsley Fern demonstrates how complex natural forms can arise from simple probabilistic rules. Using an Iterated Function System (IFS) with four affine transformations, the algorithm produces a remarkably realistic fern leaf.
Four Affine Transformations:
Algorithm:
- Start at origin:
$(x_0, y_0) = (0, 0)$ - Randomly select transformation according to probabilities
- Apply transformation:
$(x_{n+1}, y_{n+1}) = f_i(x_n, y_n)$ - Plot the point
- Repeat 10,000-1,000,000 times
- Self-Similarity: Each leaflet resembles the entire fern
- Probabilistic Rendering: Different runs produce slightly different images
- Emergent Structure: Complex form from simple rules
- Biological Realism: Mimics natural fern morphology
- Iterations: 10,000-1,000,000 (more = denser rendering)
- Point Size: 1-3 pixels (affects visual density)
- Color: Typically green, but customizable
- Background: White or transparent for overlay
- L-System Research: Compare IFS with Lindenmayer systems
- Biological Modeling: Study plant morphogenesis
- Compression Algorithms: Fractal image compression techniques
- Education: Demonstrate emergence and self-organization
The Sierpiński Triangle, named after Polish mathematician Wacław Sierpiński (1915), is one of the simplest and most elegant fractals. Constructed by recursively removing triangular sections from an equilateral triangle, it demonstrates perfect self-similarity and has a well-defined fractal dimension.
Recursive Definition:
- Start with an equilateral triangle
- Subdivide into 4 congruent equilateral triangles
- Remove the central triangle
- Recursively apply steps 2-3 to each remaining triangle
Chaos Game Algorithm:
Alternatively, generate via random iteration:
- Choose three vertices of an equilateral triangle
- Start at a random point
- Randomly select one of the three vertices
- Move halfway toward that vertex
- Plot the point
- Repeat steps 3-5
Fractal Dimension: $$ D = \frac{\log 3}{\log 2} \approx 1.585 $$
Area:
After
Perimeter:
After
- Perfect Self-Similarity: Each component is an exact scaled copy
- Three-fold Symmetry: Rotational and reflectional
- Lacunarity: Increasing "gappiness" with iteration depth
- Scaling: Each level contains 3 copies at 1/2 scale
- Iteration Depth: 1-10 levels (higher = more detail, slower rendering)
- Rendering Method: Recursive subdivision or chaos game
- Color Options: Solid color, gradient by generation, or rainbow
- Size: Scalable vector rendering available
- Fractal Dimension Education: Analytically verifiable dimension
- Chaos Game Demonstration: Show deterministic chaos equivalence
- Geometric Patterns: Tessellation and design applications
- Information Theory: Pascal's triangle mod 2 connection
| Fractal | Type | Dimension | Symmetry | Computational Complexity |
|---|---|---|---|---|
| Mandelbrot | Complex iteration | ~2.0 | Symmetric | O(n × iterations) |
| Julia | Complex iteration | ~2.0 | Rotational | O(n × iterations) |
| Burning Ship | Complex iteration | ~2.0 | Asymmetric | O(n × iterations) |
| Newton | Root finding | Varies | n-fold | O(n × iterations) |
| Barnsley Fern | IFS | ~1.5 | Bilateral | O(points) |
| Sierpiński | Geometric | 1.585 | Three-fold | O(3^depth) |
- NumPy Vectorization: Parallel computation for all pixels
- GPU Acceleration: Optional CUDA/OpenCL support (future)
- Adaptive Iteration: Automatic adjustment based on zoom level
- Multi-threading: Tile-based rendering for large images
- Escape Time Coloring: Iterations until divergence (Mandelbrot, Julia, Burning Ship)
- Basin Coloring: Which root converged to (Newton)
- Density Mapping: Point accumulation (Barnsley Fern)
- Generation Coloring: Recursive depth (Sierpiński)
- Raster Formats: PNG (with alpha), JPEG, TIFF
- Vector Formats: SVG (for geometric fractals)
- High-Resolution: Up to 8K with batch rendering
- Metadata: EXIF tags with parameters for reproducibility
-
Mandelbrot Zoom: Start at
$c = -0.7 + 0.3i$ , zoom into seahorse valley -
Julia Morphing: Vary
$c$ continuously to see set connectivity changes -
Newton Variations: Try
$f(z) = z^4 - 1$ or$z^5 - 1$ for different symmetries - Fern Parameters: Modify transformation matrices to create new "species"
- Calculate theoretical fractal dimension of Sierpiński Triangle
- Prove Julia set connectivity based on Mandelbrot membership
- Derive Newton iteration formula from Taylor series
- Analyze IFS contraction ratios for Barnsley Fern
- Mandelbrot, B. (1980). Fractal Aspects of the Iteration of $z \to \lambda z(1-z)$ for Complex $\lambda$ and $z$
- Julia, G. (1918). Mémoire sur l'itération des fonctions rationnelles
- Barnsley, M. (1988). Fractals Everywhere
- Mandelbrot, B. (1982). The Fractal Geometry of Nature
- Peitgen, H.-O., et al. (2004). Chaos and Fractals: New Frontiers of Science
- Falconer, K. (2014). Fractal Geometry: Mathematical Foundations and Applications
- Mandelbrot Set on Wikipedia
- Julia Set on Wikipedia
- Barnsley Fern on Wikipedia
- Sierpiński Triangle on Wikipedia