Visualizations
262 / 500

262 · Nature

Phyllotaxis

The golden angle emerges from inhibition on a growing shoot tip, then builds a sunflower.

This is the Douady-Couder model: each new primordium appears on the rim of the shoot apex wherever the summed inhibition from existing primordia first falls to a threshold, and every primordium then drifts outward with exponential growth. Since the inhibition only ever falls, the next birth time is found exactly by bisection and the simulation jumps from event to event. Nothing in the code mentions 137.5 degrees: as the inhibition range Γ shrinks relative to the apex, alternate 180 degree leaves bifurcate into a spiral whose divergence angle rings down onto the golden angle while the parastichy numbers climb the Fibonacci ladder, and a shorter-range inhibitor seeded with a whorl locks into alternating whorls of four. The same sequence of angles builds a sunflower head (florets at constant area, the transition primordia becoming bracts and ray petals), a turning pine cone and two succulent rosettes.

Try it. Pick Sunflower, Pine cone, Rosette or Whorled to grow that organ from its own Γ schedule. Drag the Γ slider (or use the arrow keys) to take over and watch spirals reorganise or whorls break up live. Click the apex or press W to restart from a whorl of four, click anywhere else or press Space to regrow, and use 1 to 4 to switch organs.

  • Douady-Couder inhibition model
  • Event-driven bisection
  • Parastichy lattice analysis
  • Vogel packing

View the source · one module, plus a small shared runtime for sizing, the animation loop and input

Build your own

Paste this into Claude Code, Codex or any coding agent to get a simple version running, then take it wherever you like.

Build a phyllotaxis simulation where the golden angle emerges on its own, using 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 (scale by devicePixelRatio), and has a warm cream background.
- Model the tip of a shoot as a circle of radius 1. Keep a list of primordia, each with an angle and a birth time. A primordium's distance from the centre is exp(now - birthTime), so they all drift outward.
- Define the inhibition at a point on the rim as the sum over primordia of (G / distance) cubed, where G is the inhibition range.
- Each step, advance time a little, sample the inhibition at 360 points around the rim, and when the smallest value drops below 1, add a new primordium at that angle.
- Draw the primordia as green circles whose size grows with their distance, and print the angle between the last two births.
- Start with G around 3 and shrink it slowly as more primordia appear. Do not put 137.5 anywhere in the code.

Once that works, make it beautiful:
- Plot the divergence angle of every birth on a small chart with a dashed line at 137.5 degrees, so you can watch it settle there from 180.
- Add a slider for G so the visitor can push the pattern around, and draw the inhibition around the rim as a ring that dips where the next primordium will appear.
- Use the same sequence of angles to draw a sunflower head: place the k-th youngest floret at radius proportional to the square root of k, with golden petals around the rim.

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 finding birth times exactly with bisection, seeding a pair or a whorl of primordia to see whorled patterns, or rendering a pine cone with the same angles.
PreviousNEAT SpeciesNetworks grow their own topology to balance two poles, while species rise and fall. NextMenger FlythroughAn endless dive into a sunlit Menger sponge that never runs out of smaller holes.

Related visualizations

  • RomanescoFractals A romanesco head of cones on cones on cones, with a dive into its endless florets.
  • Leaf VenationNature Veins chase auxin sources across a growing leaf, pressed onto a herbarium sheet.
  • Bloom3D Procedural flowers open from bud to bloom, with ruffled, translucent, veined petals.
  • Climbing VineNature Sweet pea shoots circle, grab supports with tendrils and coil into springs.
  • Snowflake GrowthNature Steer the weather on a Nakaya diagram and grow one-of-a-kind snowflakes.
  • Floral OrnamentGenerative art Scrolls, acanthus leaves and flowers grow to fill any frame, like an engraver's panel.
  • Fractal TreeNature A recursive tree that grows, blossoms and sways in the wind.
  • Forest of LightNature Trees grow by competing for light in a watercolor forest that turns with the seasons.
  • Neuron GrowthNature A Golgi-stained circuit grows its dendrites and axons, wires up, then fires.

Use ← and → to move between demos. While the canvas has focus, keys go to the demo instead.

← More from Emergent Mind Labs