• Remix
  • Share
  • New Entry

on 20 Nov 2023
  • 15
  • 9
  • 0
  • 0
  • 532
drawframe(1);
function drawframe(f)
len = 5;
thetaFlip = pi/8;
dspan = 2*len*sin(thetaFlip);
x = dspan*double(f>24);
theta = interp1([0 24 25 48],[0 thetaFlip -thetaFlip 0],f);
d = len*sin(theta);
h = len*cos(theta);
clf
xl = [0.1*dspan 4.9*dspan];
yl = [-len 2*len];
patch(xl([1 2 2 1]),[yl(1) yl(1) yl(2)/4 yl(2)/4],-1*[1 1 1 1],[0.9 1 0.9])
h = line([x x+d x+2*d],[0 h 0], ...
LineWidth=3, ...
Marker=".",MarkerSize=24);
for n = 1:5
h2 = copyobj(h,gca);
h2.XData = h2.XData + n*dspan;
end
set(gca,Color=[0.9 0.9 1])
axis equal
box on
set(gca,XTick=[],YTick=[])
axis([0.1*dspan 4.9*dspan -len 2*len])
end
Animation
Remix Tree