- /
-
Starr Rose
on 29 Nov 2023
- 8
- 22
- 0
- 1
- 332
drawframe(1);
Write your drawframe function below
function drawframe(f)
t = linspace(0,2*pi,300);
a=8;
b=16;
c=6;
d=3;
r=2+d/2*sin(a*t);
t=t+sin(b*t)/c;
NC=50;
l=(NC:-1:1)'/NC;
[R,F]=meshgrid(r,l);
[T,F]=meshgrid(t,l);
X=F.*(R.*cos(T+F*2*pi/a-pi/b/2+pi/4*(f-1)/47));
Y=F.*(R.*sin(T+F*2*pi/a-pi/b/2+pi/4*(f-1)/47));
contourf(X,Y,R,NC,'EdgeColor','none');
colormap(hsv2rgb([linspace(1,0,NC)'*1/6,ones(NC,1),ones(NC,1)]));
axis equal off;
end