%EVOLDEMO  animierte grafische Demo zur Definition von Kreis-Evolventen
%   Copyright 2003 HSZ-T , Dr. Stefan Adam
 
t = 2*pi*(0:0.01:1.4);
w = 2*pi*(0:0.01:1);
clf
hold on
R=1;
polx = R;
poly = 0;
xkri = R*cos(w);
ykri = R*sin(w);
plot(xkri,ykri,'k')
axis([-12 12 -12 12])
axis square
Mofram=moviein(length(t));
for k=1:length(t)
  lx = 0:0.005*2*pi:t(k);
  bix = (R)*cos(lx);
  biy = (R)*sin(lx);
  vx = [(R)*cos(t(k)) (R)*cos(t(k))+R*t(k)*sin(t(k))];
  vy = [(R)*sin(t(k))  (R)*sin(t(k))-R*t(k)*cos(t(k))];
  pnewx = (R)*cos(t(k)) + R*t(k)*sin(t(k));
  pnewy = (R)*sin(t(k)) - R*t(k)*cos(t(k));
  if k > 1 
    delete(arc);
    delete(vec);
    delete(pt);
  end
  arc  = plot(bix,biy,'g');
  vec = plot(vx,vy,'g');
  pt = plot(pnewx,pnewy,'m.');
  plot([polx pnewx],[poly pnewy],'r');
  polx = pnewx;
  poly = pnewy;
  plot(bix, biy,'g');
  Mofram(:,k)=getframe;
  pause(0.1)
% input('weiter?')
end 
pause(0.8);
movie(Mofram,-3);
movie(Mofram,1);
