Impact-Site-Verification: dbe48ff9-4514-40fe-8cc0-70131430799e

Search This Blog

Rising SUN in MATLAB (m File)

MATLAB Program:


figure;
pause(5);
fill([-20 -20 20 20],[-20 20 20 -20],'k');
pause(1);
hold on;
t=0:0.01:6*pi;
x=sin(t).*cos(t).^3;
plot(t,x,'w','linewidth',2);
hold on;
for i=1:50
q=[t;x];
e=pi/20*i;
z=[cos(e) -sin(e);sin(e) cos(e)];
k=z*q;
r=k(1,:);
d=k(2,:);
plot(r,d,'w','linewidth',2);
pause(0.3);
axis equal;
end
t=0:0.01:6*pi;
x=-sin(t).*cos(t).^3;
plot(t,x,'w','linewidth',2);
hold on;
for i=1:50
q=[t;x];
e=-pi/20*i;
z=[cos(e) -sin(e);sin(e) cos(e)];
k=z*q;
r=k(1,:);
d=k(2,:);
plot(r,d,'w','linewidth',2);
pause(0.3);
hold on;
axis equal;
end
hold on;


No comments

Popular Posts

Followers