- /
-
wiggle
on 1 Dec 2023
- 8
- 53
- 0
- 1
- 540
drawframe(28);
Write your drawframe function below
function drawframe(f)
% i gotta figure out how to make the colors add so if the red and blue
% circles overlap i get magenta, etc. :/
f=f/4;
close
circ = @(cx, cy, r) [cx + r * sind(0:1:360).^(f/3);
cy + r * cosd(0:1:360).^(f/3)];
rt = @(th) [cosd(th) -sind(th);
sind(th) cosd(th)];
f=f*8;
c1 = (circ(0,0,4)'*rt(180*f/48))';
c2 = (circ(0,0,4)'*rt(120+180*f/48))';
c3 = (circ(0,0,4)'*rt(240+180*f/48))';
fa = 1;%0.7*sind(f*180/48)^2 + 0.05;
plot(c1(1,:), c1(2,:), 'Color', [1 0 0 0.5], 'LineWidth', 30); %, 'FaceAlpha', fa, 'EdgeAlpha', 0)
hold on
% plot(c1(1,:), c2(2,:), 'Color', [1 0 0 0.5], 'LineWidth', 30); %[1 0 0 0.5], 'FaceAlpha', fa, 'EdgeAlpha', 0)
% hold on
plot(c2(1,:), c2(2,:), 'Color', [0 1 0 0.5], 'LineWidth', 30); %[0 1 0 0.5], 'FaceAlpha', fa, 'EdgeAlpha', 0)
hold on
% plot(-c2(1,:), -c2(2,:), 'Color', [0 1 0 0.5], 'LineWidth', 30); %[0 1 0 0.5], 'FaceAlpha', fa, 'EdgeAlpha', 0)
% hold on
plot(c3(1,:), c3(2,:), 'Color', [0 0 1 0.5], 'LineWidth', 30); %[0 0 1 0.5], 'FaceAlpha', fa, 'EdgeAlpha', 0)
hold on
% plot(-c3(1,:), -c3(2,:), 'Color', [0 0 1 0.5], 'LineWidth', 30); %[0 0 1 0.5], 'FaceAlpha', fa, 'EdgeAlpha', 0)
%
xlim([-7 7]); ylim([-7 7]);
xticks([]); xticklabels([]);
yticks([]); yticklabels([]);
end