Random fractal curves grown tip first from Loewner's equation, kappa by kappa.
Schramm-Loewner evolution SLE(kappa) is the curve you get by feeding Loewner's equation a Brownian motion scaled by the square root of kappa, and it is the scaling limit of loop-erased walks (2), Ising interfaces (3), percolation hulls (6) and spanning tree paths (8). Each of 20,000 time steps is a vertical slit map with a closed form, and the zipper algorithm composes their inverses to find every new tip, so the curve grows live from the real line. Behind it, a lattice of points is pushed forward through every slit map, and marching squares draws the level lines of g_t: a square grid flowing around the curve. For kappa above 4 the curve touches itself and the line, and a flood fill over a rasterized copy finds each region it swallows and washes it in the ink of that moment.
Try it. Drag the kappa slider and release to regrow the same Brownian path at the new kappa, or press 1 to 9 or the arrow keys. Click for fresh noise, Space pauses, R replays. Left alone, it tours the famous values.
Paste this into Claude Code, Codex or any coding agent to get a simple version running, then take it wherever you like.
Build a Schramm-Loewner evolution (SLE) curve generator with JavaScript and the HTML canvas element. Put everything in a single index.html file with no libraries or build step, so I can open it directly in a browser.
Start simple:
- Make a canvas that fills the window, stays sharp on high-DPI screens, and draws the upper half plane: the real line near the bottom, the origin at its center.
- Build a driving function: W[0] = 0 and W[k] = W[k-1] + sqrt(kappa * dt) * (a standard normal sample), for N = 4,000 steps with dt = 0.4 / N. Start with kappa = 6.
- Hold W constant on each step. The inverse Loewner map for step k is then f_k(w) = W[k] + sqrt((w - W[k])^2 - 4 dt), using complex arithmetic and always choosing the square root with a non-negative imaginary part.
- The tip after n steps is f_1(f_2(...f_n(W[n]))): start at the real number W[n] and apply the maps from k = n down to 1. That is the zipper algorithm.
- Each animation frame, compute a few dozen new tips and draw the curve as a polyline, so it grows tip first from the origin.
Once that works, make it beautiful:
- Draw it like ink on paper: a warm paper background, a dark ink line whose color shifts with the time each point was born, and a glowing drop at the tip.
- Add a kappa slider from 0 to 10. Keep the same normal samples when kappa changes, so the same random path regrows at the new kappa. Watch it go from simple (below 4) to touching itself (4 to 8) to filling space (above 8).
- Label the famous values: 2 is loop-erased random walk, 3 is the Ising interface, 6 is percolation, 8 is the uniform spanning tree.
Explain the key ideas in short code comments. When you're done, tell me how to open it and suggest three directions I could take it next, such as drawing the conformal grid around the curve by pushing points forward through each step's map, shading the regions the curve swallows, or a radial version that grows inside a disk.