clear all;clf
a=1;
t=(1:720)./180*pi;
x=a*(t-sin(t));
y=a*(1-cos(t));
plot(x,y,"k-");hold on
t1=t+pi;
x1=a*(t1-sin(t1))-pi;
y1=a*(-1-cos(t1));
plot(x1,y1,"g:")
for i=1:length(t)
h0=plot(x(i),y(i),"ko");
h1=plot(x1(i),y1(i),"ro");
h2=plot([x(i) x1(i)],[y(i) y1(i)],"b-");
pause(0.01);
delete(h0);
delete(h1);
delete(h2);
if i>1
plot(x1(i-1:i),y1(i-1:i),"r-")
end
clear all;clf
a=1;
t=(1:720)./180*pi;
x=a*(t-sin(t));
y=a*(1-cos(t));
plot(x,y,"k-");hold on
t1=t+pi;
x1=a*(t1-sin(t1))-pi;
y1=a*(-1-cos(t1));
plot(x1,y1,"g:")
for i=1:length(t)
h0=plot(x(i),y(i),"ko");
h1=plot(x1(i),y1(i),"ro");
h2=plot([x(i) x1(i)],[y(i) y1(i)],"b-");
pause(0.01);
delete(h0);
delete(h1);
delete(h2);
if i>1
plot(x1(i-1:i),y1(i-1:i),"r-")
end
end