• Remix
  • Share
  • New Entry

on 30 Nov 2023
  • 12
  • 13
  • 0
  • 0
  • 407
drawframe(7);
Write your drawframe function below
function drawframe(f)
N = 4*3*5*4;
F = 4;
r = linspace(N/2.5,N/3.5,25);
i = 25-abs(f-24);
R = F*r;
G = 180/F;
d = N - abs(R-r);
for K = 2.^(0:-1:-7);
t=linspace(0,2*pi*r(i),1000)';
x=(R(i)-r(i))*cos(t)+d(i)*cos((R(i)-r(i))/r(i)*t);
y=(R(i)-r(i))*sin(t)-d(i)*sin((R(i)-r(i))/r(i)*t);
for a=G:G:90
c = cosd(a);
s = sind(a);
k = K/(c+s);
xp = c*x - s*y;
yp = s*x + c*y;
xp = [xp;xp(end)];
yp = [yp;NaN];
plot(k*xp,k*yp,'color',[1 1 1]*(i/26));
hold on;
end
end
%hold off;
axis equal off;
end
Animation
Remix Tree