Eine animierte Darstellung, mit einem Salto Mortale rückwärts des ,,L`` wird durch das M-File 'lsalto.m' produziert.
%lsalto.m : Salto Mortale rueckwarts des "L"
clf; L = [5 5 6; 2 0 0; 1 1 1]; lhand = plothclin(L);
stdhcaxis; hold on
B = [ 1 0 -5; 0 1 0 ; 0 0 1]*L; dw = pi/36;
for k = 1:36
T = [cos(2*k*dw) -sin(2*k*dw) 5*cos(k*dw); ...
sin(2*k*dw) cos(2*k*dw) 5*sin(k*dw); 0 0 1];
Lt = T*B;
% input('WEITER?'); % Einzelschritte mit Prompt
pause(0.12); delete(lhand); lhand = plothclin(Lt);
end
input('APPLAUS!!');
% plothandle = plothcl3(Lmat,colorstring)
% 3D-Plot einer Linie aus einer Matrix von Spaltenvektoren
% in 3D homogenen Koordinaten
function plothandle = plothcl3(lmat,colorstring)
if exist('colorstring') == 0; col = 'k'; else
col = colorstring; end
plothandle = plot3(lmat(1,:),lmat(2,:),lmat(3,:),col);
Damit ist die Bahn frei für die animierte 3D Darstellung, abgelegt im File 'lrotmirr3D.m'
% lrotmirr3D.m - 3D "L" dreht sich vor dem Spiegel
spiegel=[0 4 4 0 0;0 0 0 0 0;0 0 3 3 0;1 1 1 1 1];
% Randpunkte des Spiegels und Spiegelmatrix
spm=[1 0 0 0;0 -1 0 0;0 0 1 0;0 0 0 1];
plothcl3(spiegel,'b') ; hold on
axis ([-6 6,-6 6 0 12]) ; axis square
set(gca,'CameraPosition',[-15 -100 27])
% Drehen des "L" in Schritten von 5 Grad
for lw=0:2:360
w=lw*pi/180; kopf= [2 -4 2 1]';
ecke=[2 -4 0 1]'; zehe=[2+cos(w) -4+sin(w) 0 1]';
% "L" zusammensetzen und spiegeln
LM=[kopf ecke zehe]; LV=spm*LM;
hm=plothcl3(LM,'k'); hv=plothcl3(LV,'r');
pause(0.1)
if lw < 360
delete(hv); delete(hm)
end
end