- /
-
Four-seasons flowers
on 30 Nov 2023
- 14
- 24
- 0
- 0
- 620
drawframe(1);
Write your drawframe function below
function drawframe(f)
if f==1
ax=axes('position',[0 0 1 1]);
end
e1=spring;
e2=summer;
e3=autumn;
e4=winter;
co={e1(f*5,:),e2(f*5,:),e3(f*5,:),e4(f*5,:)};
theta=-2*pi:pi/100:2*pi;
a=cos(theta);
b=sin(theta);
c=a.*b*sin(f*pi/30)*cos(f*pi/8);
d=1/50*(50-f);
for i=2:2:4
fill([a flipud(a)]*d+i,[c flipud(c)]*d,co{i/2},'edgecolor','none')
hold on
fill([c flipud(c)]*d+i,[a flipud(a)]*d,co{i/2},'edgecolor','none')
hold on
end
i=3;
c=a.*b*sin(f*pi/84)*sin(f*pi/120)*exp(f*pi/60);
for j=-1:2:1
fill([a flipud(a)]*d+i,[c flipud(c)]*d+j,co{(1+j)/2+3},'edgecolor','none')
hold on
fill([c flipud(c)]*d+i,[a flipud(a)]*d+j,co{(1+j)/2+3},'edgecolor','none')
hold on
end
axis off
g=gcf;
g.Color='k';
end