The image below shows the arrangement of seeds in the middle of a sunflower. The seeds are arranged in a pattern - generally knows as phyllotaxis. In nature, many plants show this arrangement of leaves and seeds.

This post helped in understanding the mathematics behind the arrangement. Three things noted in the arrangement are:

Hence, in the polar coordinates, we can specify \([r,\theta] = [\sqrt(i), \Gamma*i]\). Since I wanted to plot the points on cartersian coordinates, I used the polar to Cartesian conversion factors:

  1. \(x = rCos(\theta)\)

  2. \(y = rSin(\theta)\) and plugged in the values of r and the angle \(\Gamma\) for each location.

x<- c()   
y <- c()  

goldenratio <- 1.618
gamma <- 2*pi*(1-goldenratio)  

for (i in 1:1000){
  x<- c(x,sqrt(i)*cos(i*gamma))
  y<- c(y,sqrt(i)*sin(i*gamma))
 
}

df <- data.frame(x = x, y = y)

p <- ggplot(data = df, aes(x=x,y=y))+
  geom_point()

p

I generated the animation below and here using gganimate() package. I experimented with values of \(\phi\) other than golden ratio in both graphics. The beautiful flower patterns in the animation here appear because of tweening (interpolation of data points while transitioning from one state to the next). gganimate uses tweenr (another R package) for interpolating the data during transitions between states. More geometric art R scripts on github

amber.m.ahmed@utexas.edu

Copyright © , Amber Ahmed. All rights reserved.