• Remix
  • Share
  • New Entry

on 10 Nov 2023
  • 6
  • 14
  • 1
  • 0
  • 480
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);
cla
line(b+cos(-b),sin(-b),Color=[1 f/48 f/48],LineWidth=12)
h1 = line(cos(a)+theta,sin(a),Color=[0 0.447 0.741],LineWidth=2);
h2 = line(theta+[0 cos(-theta)],[0 sin(-theta)],Color=0.7*[1 1 1]);
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 off
axis([0 4*pi -2 2])
patch([-1 5*pi 5*pi -1 -1],[-1 -1 -5 -5 -1],0.8*[1 1 1])
end
Animation
Remix Tree