Colorful Design with MATLAB
Code:
figure;
pause(5);
t=0:pi/20:pi/2;
x=5*cos(t);
y=5*sin(cos(t)).^2;
a=x(2);
b=y(2);
axis
equal;
hold
on;
for i=1:25
hold
on;
q=[x+a;y+b];
q=q;
e=pi/10*i;
z=[cos(e)
-sin(e);sin(e) cos(e)];
k=z*q;
r=k(1,:)-a;
d=k(2,:)-b;
plot(r,d,'g','linewidth',2);
hold
on;
axis
square;
pause(0.3);
end
hold
on;
t=0:pi/20:pi/2;
x=5*cos(t);
y=5*sin(cos(t)).^2;
a=x(2);
b=y(2);
axis
equal;
hold
on;
for i=1:25
hold
on;
q=[x+a;y+b];
q=q;
e=-pi/10*i;
z=[cos(e)
-sin(e);sin(e) cos(e)];
k=z*q;
r=-k(1,:)-a;
d=k(2,:)-b;
plot(r,d,'r','linewidth',2);
hold
on;
axis
square;
pause(0.3);
end
t=0:pi/20:pi/2;
x=5*cos(t);
y=5*sin(cos(t)).^2;
a=x(2);
b=y(2);
axis
equal;
hold
on;
for i=1:25
hold
on;
q=[x+a;y+b];
q=q;
e=pi/10*i;
z=[cos(e)
-sin(e);sin(e) cos(e)];
k=z*q;
r=k(1,:)-a;
d=k(2,:)-b;
plot(r,d,'r','linewidth',2);
hold
on;
axis
square;
pause(0.3);
end
hold
on;
t=0:pi/20:pi/2;
x=5*cos(t);
y=5*sin(cos(t)).^2;
a=x(2);
b=y(2);
axis
equal;
hold
on;
for i=1:25
hold
on;
q=[x+a;y+b];
q=q;
e=-pi/10*i;
z=[cos(e)
-sin(e);sin(e) cos(e)];
k=z*q;
r=-k(1,:)-a;
d=k(2,:)-b;
plot(r,d,'g','linewidth',2);
hold
on;
axis
square;
pause(0.3);
end
Join us on Telegram : https://t.me/matlabirawen
No comments