• Remix
  • Share
  • New Entry

on 29 Nov 2023
  • 14
  • 13
  • 0
  • 0
  • 216
drawframe(8);
Write your drawframe function below
function drawframe(f)
d=pi/8*(1+cos(4*pi*(f-1)/47));
a=0:d:720;
X=[-1 -1 1 1 -1;1 -1 -1 1 1];
s=1/(cos(d)+sin(d));
c=turbo(48);
x=X;
for i=1:length(a)
X = s*[cos(d) sin(d);-sin(d) cos(d)]*X;
x = [x X];
end
plot(x(1,:),x(2,:),'color',c(f,:)); axis equal off;
end
Animation
Remix Tree