• Remix
  • Share
  • New Entry

  • Teodo

  • /
  • Virus evolution under Microscope

on 17 Nov 2023
  • 5
  • 5
  • 0
  • 0
  • 439
drawframe(1);
Write your drawframe function below
function drawframe(f)
% Every program run, gives a different animation...
s1=figure('Position',[0,0,500,500]);
plot(0,0)
prec=20000;
hold on
xlim([-prec*1.5,prec*1.5]);
ylim([-prec*1.5,prec*1.5]);
axis off
nl=zeros(2,round(rand*25+15));
for i=1:size(nl,2)
nl(:,i)=[prec*rand,prec*rand];
end
for ug=0:60:300
rot=[cosd(ug), -sind(ug); sind(ug), cosd(ug)];
for i=1:2:size(nl,2)-1
ppriv=rot*nl(:,i);
dpriv=rot*nl(:,i+1);
g=plot([ppriv(1),dpriv(1)],[ppriv(2),dpriv(2)],'Color',[.5*rand+.35,.5*rand+.35,.5*rand+.35],'LineWidth',10);
hold on
end
end
end
Animation
Remix Tree