- /
-
Streamers
on 16 Nov 2023
- 9
- 21
- 0
- 0
- 481
drawframe(18);
Write your drawframe function below
function drawframe(f)
theta = interp1([0 48],[0 2*pi]+pi/2,f);
a = linspace(0,2*pi);
b = linspace(pi/2,theta);
r = [0.2 1 1.8];
clf
for n = 1:length(r)
line(b+r(n)*cos(-b),r(n)*sin(-b),Color=[1 f/48 f/48],LineWidth=5)
end
h1 = line(cos(a)+theta,sin(a),Color="black");
h2 = line(theta+[r*cos(-theta)],[r*sin(-theta)], ...
Color="red", ...
Marker=".",MarkerSize=12);
for k = [-1 1]
h1c = copyobj(h1,gca);
h1c.XData = h1c.XData + k*2*pi;
h2c = copyobj(h2,gca);
h2c.XData = h2c.XData + k*2*pi;
end
axis equal
axis([0 3*pi -2 2])
axis off
end