Fractal Explorer

A shared engine for exploring fractals and dynamical systems, built with TypeScript, WebGPU, and Rust/WASM. Each map defines its own calculations and presentation, while the engine handles smooth pan and zoom, progressive tile rendering, and precision changes: GPU calculations give way to CPU workers when finer coordinates are needed, with a full CPU fallback when WebGPU is unavailable. Published as part of Nebelmesser’s Playground. Source code: GitHub.

Double pendulum

Grayscale double-pendulum map with branching boundaries

Every pixel releases a double pendulum from rest at a different pair of angles. Brightness records how long the upper rod takes to accumulate a full turn from its starting angle: pale regions last longer, dark regions turn sooner. Smooth bands break into branching boundaries where almost identical starts produce different motion.

Zoom into a boundary, place a grid of pendulums on the map, and watch their paths separate. The single-pendulum mode compares one starting position with two neighboring pixels. Changing rod lengths, masses, friction, or the time step reshapes the map; at extreme zoom, separated sample squares reveal the limit of floating-point coordinates.

Magnetic pendulum

Red, green, and blue regions of the magnetic-pendulum map

Each pixel drops a pendulum bob from rest above three magnets arranged in a triangle. Red, green, and blue represent the magnets, mixed by the time the bob spends near each one. Broad regions of similar motion meet along tangled boundaries, where a tiny change in the release point can send the bob toward another magnet.

Hover over the map to follow a single trajectory, then zoom into the colored edges to see how the regions interleave. Gravity pulls the bob toward the center and friction gradually damps its motion. The settings let you change magnet strength, height above the table, friction, and integration step to explore how those boundaries move.

Lyapunov fractal

Gold stability windows and blue chaotic regions in the Lyapunov fractal

The logistic rule x ← r x (1 − x) can settle into a repeating cycle or become chaotic. Here the growth parameter follows a repeating rhythm of two values, A and B, supplied by each pixel’s position. The default rhythm is AABAB. Gold marks a negative Lyapunov exponent, where nearby starts converge; blue marks a positive exponent, where they separate.

The dark shoreline between stability and chaos folds into nested windows and fine filaments as you zoom. Hover to inspect A, B, and the exponent at a point. Change the A/B rhythm, initial value, or sampling accuracy to compare different parameter landscapes and see how a short repeating rule produces a complicated boundary.

Chirikov–Taylor map

Colored resonance islands and curved layers of the Chirikov–Taylor map

Every pixel starts an orbit at an angle and momentum, then follows a sequence of kicks in the Chirikov–Taylor standard map. Smooth colored layers trace regular motion, while broken and speckled layers reveal chaos. Hue follows the orbit’s average phase; brightness reflects how coherently it stays in one rotational layer.

The opening kick strength is close to the breakup of a major invariant barrier, where regular islands coexist with chaotic layers. Change K to move from gently bent curves toward widespread chaos, or zoom into the islands and their surrounding structure. The iteration control changes the number of kicks sampled for every pixel.

Mandelbrot & Julia

Black Mandelbrot set surrounded by blue, cyan, cream, and gold escape-time bands

Starting at z = 0, the Mandelbrot map repeatedly applies z ← z² + p, where each pixel supplies the complex number p. Black points have not escaped within the iteration limit; blue, cyan, cream, and gold bands show smooth escape time. The transition slider continuously changes the rule to a Julia set through z₀ = t p and c = (1 − t) p + t c_J, with an adjustable Julia constant.

Hover or tap to select an orbit and follow it both on the map and in a persistent overview; the selection survives navigation. Deep zoom preserves an exact camera center and uses high-precision reference orbits with perturbation, reaching a minimum short-axis span of 1e-280. Raise the iteration limit, up to 262144, when slow-escaping boundaries remain black; difficult views can take substantially longer to compute.

Burning Ship

Black Burning Ship silhouette surrounded by warm escape-time bands

Burning Ship adds an absolute-value fold before each quadratic step: z ← (|Re(z)| + i|Im(z)|)² + c, starting at zero. This small change produces angular hulls, tall masts, and miniature ships along the boundary. Black points have not escaped within the iteration limit, while warm bands show how quickly the surrounding orbits escape. The imaginary coordinate increases downward.

Zoom along the hull to explore its folded details, and increase the iteration limit to resolve slower escapes. Hover or tap to select a parameter and see its orbit on the map and in the full-set overview. The curve persists during pan and zoom; after a short pause, moving dots show iteration order and repeat detected numerical cycles. This map uses the shared GPU f32 and CPU f64 paths.

Develop

Source lives in app/ (TypeScript, Vite, WebGPU, and Rust/WASM). Each map provides its own computation and presentation; the shared viewer handles navigation, progressive rendering, and CPU fallback. Ordinary maps use GPU f32, switching to CPU f64 workers at deep zoom. Add ?cpu=1 to any explorer URL to compute entirely in workers without requesting WebGPU; a missing adapter uses the same fallback.

cd app
npm install
npm run build

The build compiles the Rust crate with wasm-pack, checks TypeScript, and writes production HTML and content-hashed assets to fractal/. It requires the Rust wasm32-unknown-unknown target and wasm-pack on PATH.

From the parent playground repository, use ./scripts/preview and open the local explorer. Reload that HTTP URL after building. npm run dev is available for TypeScript development; built pages are previewed through the playground origin.

Map and architecture checks run from app/:

npm run test:architecture
npm run test:maps
npm run test:mandelbrot
npm run test:deep-zoom

npm run test:maps:browser:build and npm run test:deep-gpu:build generate ignored browser harnesses at /fractal/test-output/maps-browser.html and /fractal/test-output/deep-gpu.html on the playground preview. They compare real GPU kernels with CPU calculations and check fallback or pinch behavior.

License

MIT. Made by Nebelmesser.