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

Search This Blog

Alpona design using sine wave in MATLAB

MATLAB program M file:


Code:

figure;
pause(5);
fill([-20 -20 20 20],[-20 20 20 -20],'k');
hold on;
t=0:0.01:6*pi;
x=sin(t);
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);
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