L-Systems

Generation of fractal patterns with L-Systems.
Published 12/15/2025.

Lindenmayer systems or L-systems for short is a string-rewitting system introduced by Aristid Lindenmayer in 1968.

L-Systems were initially used to model the growth of plants, but they can be also be used to generate fractals patterns.

I made a simple library based on React to play with L-systems. You can find it on Github.

Hilbert Curve

X
F -> FX -> - Y F + X F X + F Y -Y -> + X F - Y F Y - F X +
F -> draw forward by 1 unit(s)+ -> turn by +90.00°- -> turn by -90.00°

Koch Curve

F
F -> F + F - F - F + F
F -> draw forward by 1 unit(s)+ -> turn by +90.00°- -> turn by -90.00°

Koch Snowflake

F + + F + + F
F -> F - F + + F - F
F -> draw forward by 1 unit(s)+ -> turn by +60.00°- -> turn by -60.00°