- /
-
Hope
on 28 Oct 2024
- 10
- 60
- 0
- 0
- 858
Cite your audio source here (if applicable):
drawframe(96);
Write your drawframe function below
tic
% Define drawframe function
function drawframe(f)
a7=animatedline("Color","m","LineWidth",13.5);
a6=animatedline("Color","b","LineWidth",13.5);
a5=animatedline("Color","c","LineWidth",13.5);
a4=animatedline("Color","g","LineWidth",13.5);
a3=animatedline("Color","y","LineWidth",13.5);
a2=animatedline("Color",[1, 0.5, 0],"LineWidth",13.5);
a1=animatedline("Color","r","LineWidth",13.5);
theta=linspace(-pi,0,f);
axis([-1 1 0 1.2]);
for j=1:length(theta)
xc1=cos(theta(j));
yc1=-sin(theta(j));
addpoints(a1,xc1,yc1);
hold on
xc2=0.9*cos(theta(j));
yc2=0.9*-sin(theta(j));
addpoints(a2,xc2,yc2);
xc3=0.8*cos(theta(j));
yc3=0.8*-sin(theta(j));
addpoints(a3,xc3,yc3);
xc4=0.7*cos(theta(j));
yc4=0.7*-sin(theta(j));
addpoints(a4,xc4,yc4);
xc5=0.6*cos(theta(j));
yc5=0.6*-sin(theta(j));
addpoints(a5,xc5,yc5);
xc6=0.5*cos(theta(j));
yc6=0.5*-sin(theta(j));
addpoints(a6,xc6,yc6);
xc7=0.4*cos(theta(j));
yc7=0.4*-sin(theta(j));
addpoints(a7,xc7,yc7);
drawnow limitrate
end
end
toc