phunction.sh
a wizard's lab on the open web — math, code, simulation, art
incipit
Description is revelation. The world is the description, & the description is the world. The fragment shader runs once per pixel, in parallel, on a screen that is already glowing. You have ~200 lines and a clock. What makes it feel like a poem rather than a function: it has a subject, a constraint, and a rhythm.
Inline code: const φ = (1 + Math.sqrt(5)) / 2;.
Inline math: .
Inline link: an anchor. Inline strike:
Mercury retrograde. Inline emphasis: panta rhei.
display math
The Mandelbrot escape iterates starting at ; the smooth-coloured iteration count is .
The Riemann hypothesis: every non-trivial zero of lies on the critical line .
A matrix and a continued fraction:
lists
unordered
- Mandelbrot —
- Julia — same recurrence, fixed
- Reaction–diffusion —
- Helmholtz —
ordered
- open a lab URL on a laptop or phone
- plug into a projector if you've got one
- leave it running
- let the room change
nested
- shaders
- vertex
- fragment
- compute
- analysis
- real
- complex
- functional
table
| symbol | lab | domain | tech |
|---|---|---|---|
∂ | fractal | ℂ | WebGL2 |
∮ | flow | ℝ² | GPU PDE |
ζ | scry | webcam | getUserMedia |
∇² | lattice | ℝ³ | vertex shader |
code block
// generate evenly-distributed hues by the golden angle
const phi = (1 + Math.sqrt(5)) / 2;
const goldenStep = 360 / phi; // ≈ 222.4922°
const palette = (n: number, h0: number, l = 76, c = 0.18) =>
Array.from({ length: n }, (_, i) =>
`oklch(${l}% ${c} ${(h0 + i * goldenStep) % 360})`
);
palette(8, 170);
// → ['oklch(76% 0.18 170)', 'oklch(76% 0.18 32.5)', ...] blockquote
"the universe is not only queerer than we suppose, but queerer than we can suppose."
— J.B.S. Haldane, Possible Worlds, 1927
definition list
- math
- the language of structure
- code
- the executable form of math
- art
- math made visible
buttons
card row
palette generated by golden ratio over dark.