• Remix
  • Share
  • New Entry

on 30 Nov 2023
  • 6
  • 9
  • 1
  • 1
  • 441
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);
C = 1-sky(8)*0.75;
K = 2.^(0:-1:-7);
for j=1:length(K)
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(j)/(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-C(j,:)*(i/26));
hold on;
end
end
%hold off;
axis equal off;
end
Animation
Remix Tree