next up previous adam-math, MATmatcc, MMKOMP MMkomp2 Adam WILEY-VCH MATLAB-Filme Projekte und M-Files Stefan Adam privat Mail to stefan.r.a.adam@gmail.com MMkomp ed1 Adam
Nächste Seite: Umstülpung eines Tetraeder-Rings Aufwärts: MMkomp2 Filmserie Vorherige Seite: Parkhausrampe

Das L vollführt einen Salto

Das -L - als einfachste zweidimensionale Figur, der man eine Spiegelung ansieht, wird als Übungsobjekt für die homogene Koordinatentransformation etabliert. Die Absolvierung eines Saltos durch das L ist ein hübsches Anwendungsbeipiel für eine Serie von Transformationen.

function voidbk = lsaltofilmx(varargin)
voidbk = 0;
%lsalto : Salto Mortale rueckwarts des "L"
L = [4 4 4.8; 0.3 -1.3 -1.3; 1 1 1];
  PT = [ 1.3 0 0; 0 1.3 -7 ; 0 0 1 ];
lhand = plothclin(PT*L);
figure(1); clf;
hold on
hdtx1 = text(-9.3,8.8,'Homogene Koordinaten-', ...
    'FontUnits','points','FontSize',16, ...
   'Fontweight','demi');
hdtx2 = text(-9.3,7.3,'Transformationen des "L"', ...
    'FontUnits','points','FontSize',16 , ...
   'Fontweight','demi');
axis([-10 10 -10 10]);  %axis square
%axis([-6.5 6.5 -1.5 11.5]);
axis square; axis off;
hdbas=plot([-6.5 6.5]*1.3,[-1.4 -1.4]*1.3-7); pause(0.2)
hold on
npt = 120;
B = [ 1 0 -4; 0 1 0 ; 0 0 1]*L;
dw = pi/npt;
%
a = 4;
b = 8;
%
for k = 1:npt
  w = k*dw;
  wori = (atan2(b*cos(w),-a*sin(w)) -pi/2)*2;
  wori*180/pi;
  T = [cos(2*wori) -sin(2*wori) a*cos(k*dw); ...
       sin(2*wori) cos(2*wori) b*sin(k*dw); ...
      0 0 1];
  Lt = PT*T*B;
  pause(0.05);
  delete(lhand)
  lhand = plothclin(Lt);
end
hdtx3 = text(-1.3,-9.6,'Applaus!', ...
    'FontUnits','points','FontSize',16, ...
   'Fontweight','demi');
pause(1.9);
delete(hdtx1);
delete(hdtx2);
% plothandle = plothclin(Lmat,colorstring)
% Plot einer Linie aus einer Matrix von Spaltenvektoren
%   in 2D homogenen Koordinaten
function plothandle = plothclin(lmat,colorstring)
if exist('colorstring') == 0  
  col = 'k';
else 
  col = colorstring;
end
plothandle = plot(lmat(1,:),lmat(2,:),col,'LineWidth',2);
end % function plothclin
end % function lsaltofilmx



2018-09-15