• Remix
  • Share
  • New Entry

on 21 Nov 2023
  • 23
  • 21
  • 1
  • 0
  • 309
drawframe(3);
Write your drawframe function below
function drawframe(f)
% Credit
% https://twitter.com/Pixelated_Donut/status/1726602167019241671
% https://twitter.com/Yugemaku/status/1726559476172616047
persistent c
if isempty(c)
c = colororder;
idx = randi(6,200,1);
c = c(idx,:);
end
phi = (1+sqrt(5))/2;
tau = 2*pi;
%% T = 0~0.5
T = 0.5/48*f;
i = 1:200;
alpha = 2*tau*phi*i - mod(phi*i-T,1).^(3/2)*tau;
x = sin(alpha).*sqrt(i);
y = cos(alpha).*sqrt(i);
scatter(x,y,25,c,'filled');
axis off equal
set(gcf,'Color','black')
xlim([-15,15]);
ylim([-15,15]);
end
Animation
Remix Tree