Skip to content

TomBonness/deathandphyllotaxis

Repository files navigation

🌻 Death & Phyllotaxis: The Golden Angle Packer

Experiment No. 04 / An interactive exploration of biological optimization.

Why aren't sunflowers stupid?

If you've ever stared at a pinecone, a pineapple, or the disk of a sunflower, you’ve witnessed a high-performance packing algorithm designed by evolution. It’s called Phyllotaxis—the mathematical arrangement of leaves or seeds to maximize density and sunlight exposure.

This project is an interactive, high-contrast sandbox that demonstrates how the Golden Angle (~137.508°) optimizes seed packing density, and how even a $0.1^\circ$ deviation triggers a structural collapse into gaps and spokes.


The Core Concept: Number Theory vs. Starvation

To pack as many seeds as possible onto a circular surface, a plant must generate seeds at a constant angle relative to the previous one.

$$\theta = n \times \text{angle}$$ $$r = c \times \sqrt{n}$$

But here lies the botanical catch: if the divergence angle is a clean fraction, the plant starves.

1. Rational Failure ($135^\circ = 3/8$)

If a plant uses an angle like $135^\circ$, it will stack seeds along exactly $8$ straight spokes, leaving $88%$ of the surface area completely empty. It has a short continued fraction expansion of [0; 2, 1, 2]. This is a biological disaster.

2. The Pi Angle ($114.592^\circ \approx 360^\circ/\pi$)

You'd think $\pi$—being irrational—would pack well. But in number theory, some irrationals are "more rational" than others. Because $\pi$ has a continued fraction starting with [3, 7, 15, 1...], the large term 7 means it is easily approximated by $22/7$. This triggers a visible alignment of $7$ curving spiral arms, leaving huge gaps in space utilization and dropping efficiency to $45%$.

3. The Golden Angle ($137.508^\circ \approx 360^\circ/\phi^2$)

To avoid gaps, the plant must use the most irrational number possible—a number that is the absolute hardest to approximate with a rational fraction.

In number theory, the Golden Ratio ($\phi \approx 1.618$) is the most irrational number because its continued fraction expansion is composed entirely of $1$s: $$[0; 2, 1, 1, 1, 1, 1, 1...]$$

Because $1$ is the smallest integer, this sequence converges as slowly as mathematically possible. Consequently, the Golden Angle places every seed at the maximum possible distance from all previous seeds, achieving a near-perfect $99%$ packing efficiency. No gaps, no spokes, just pure, uniform density.


Key Interactive Features

  • Phyllotaxis Canvas: A clean, high-performance canvas rendering up to 1,500 seeds. Watch the spiral arms emerge and collapse in real-time as you sweep across the angles.
  • Real-Time Spacing Variance Analyzer: Rather than drawing arbitrary spiral lines, the application performs a live spatial analysis. It computes the Packing Efficiency Index (0-100%) dynamically by calculating the standard deviation and mean of nearest-neighbor distance (spacing variance) across the seeds. High uniformity yields $99%$, while radial clumping drops to $10%$.
  • Dynamic Continued Fraction Chip-set: Displays the active angle's continued fraction expansion dynamically, highlighting how large terms in the expansion correspond to visible alignments and gaps.
  • Space Utilization Diagnostic: Explains the biological impact of the chosen angle in plain terms (e.g., “Severe clumping: 135° stacks seeds along 8 spokes, leaving 88% of the surface area empty.”).

About

An interactive sandbox demonstrating how the Golden Angle (~137.508°) optimizes seed packing density in plants (Phyllotaxis), featuring a real-time packing efficiency analyzer.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages