Skip to content

Instantly share code, notes, and snippets.

@olecksamdr
Last active March 25, 2022 12:36
Show Gist options
  • Save olecksamdr/9d3ce6991898f21c1a15adce4444d2d1 to your computer and use it in GitHub Desktop.
Save olecksamdr/9d3ce6991898f21c1a15adce4444d2d1 to your computer and use it in GitHub Desktop.
Draw Phyllotaxis with turtle graphics
import math
from turtle import *
shape('circle')
speed(0)
c = 15
for n in range(500):
a = n * 137.507764050
r = c * math.sqrt(n)
x = r * math.cos(a)
y = r * math.sin(a)
up()
goto(x, y)
down()
dot(20)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment