• Remix
  • Share
  • New Entry

on 12 Oct 2022
  • 9
  • 50
  • 1
  • 1
  • 251
% Sunflower Seeds:
% Use fibonacci sequence on a linear scale to make small seeds in the middle
% and bigger seeds on the edge.
n=1000;
o=1:n;
R=o.^2/n^2;
T=4/(1+sqrt(5))*pi*o;
% Create a triangulation in cartesian so we can compute a nice voronoi diagram.
[X,Y]=pol2cart(T,R);
DT=delaunayTriangulation([X;Y]');
[V,r]=voronoiDiagram(DT);
% This would be a good time to filter off the bad seeds that go off the edge
% but I don't have enough characters for that.
% Convert the vornoi faces into a patch face and colors
F=ones(n,7)*nan;
for q=1:n
F(q,1:numel(r{q}))=r{q};
end
% Draw
patch(FaceC='f',EdgeC='#070',Faces=F,Vertices=V,FaceVertexC=sqrt(1:n)');
axis equal off
Remix Tree