The Flower Garden

Mathematical Experiments with Code

Picture this: a serene river flowing through a lawn. Vibrantly coloured flowers and fern-like trees in a garden, soaking in bright sunlight.


But all of a sudden, a wild fire sweeps across the garden, destroying the upper bank of the river. It twists and curls, burning the flowers and reducing them to dust. The water, acting as a natural barrier, slows the fire down, saving the flowers on the bank closer to the audience.


Their survival seems to be a matter of luck - an accidental fortune. But Nature, in all her randomness, is calculative. Every turn of the fire is precise, every lick of flame intentional. The flowers survived death not by chance, but by selection.

This isn't just art, it's also math!


But how can math be used to create art?

Parametric Functions

Multiple circles with different amplitudes and different rotating frequencies form the rotationally symmetric forms of the flowers.

Affine Transformation Fractals

The fern is a direct application of affine transformations - each transformation (stem, main body, and leaves) follows the affine formula (Ax + B), adjusting the coordinates based on scaling, rotation, and translation. Since different transformations are applied with different probabilities, the fractal structure emerges naturally.

Dragon Curve Fractal

The fire emerges from a Dragon Curve, a type of fractal that is generated by recursively folding a line at right angles. It creates a complex, self-similar pattern that looks a bit like a jagged dragon or a swirling spiral.

Sine Waves

Between our garden runs a stream of water that irrigates the flora. This stream of water is essentially a quadrilateral shape where 2 of the sides have been plotted as sine curves of different frequencies and amplitudes. 

We used p5.js (A JavaScript library that is like a software sketchbook!) to code this garden.

Reach out so we can meld minds!

You know you loved scrolling :)

in

Create a free website with Framer, the website builder loved by startups, designers and agencies.