- /
-
ArachnoPrism Vortex
on 8 Nov 2023
- 8
- 33
- 4
- 0
- 457
drawframe(1);
Write your drawframe function below
function drawframe(f)
cla
x = linspace(0,4*pi,200);
nLines = 12;
theta = 2*pi*(1:nLines)/nLines;
hgtRoot = hgtransform;
hgt = zeros(1,nLines);
for i = 1:nLines
hgt(i) = hgtransform(Parent=hgtRoot);
y = 1/3*x.*sin(x+i/2);
line(x,y,Parent=hgt(i),Color="yellow",LineWidth=2);
R = makehgtform('zrotate', theta(i));
set(hgt(i),Matrix=R)
end
axis equal
axis off
grid on
axis(12*[-1 1 -1 1])
alpha = interp1([0 48],[0 48*2*pi/nLines],f)
R = makehgtform('zrotate', alpha);
set(hgtRoot,Matrix=R)
set(gcf,Color="black")
end
Animation
![](/responsive_image/300/300/0/0/0/cache/matlabcentral/communitycontests/uploaded_files/14532/animation.gif?a=true)