n=5 D = zeros(4*n) for zei = 1:4*n for spa = zei:min(zei-n+1,4*n) D(zei,spa) = 6 end end spy(D)
a = [4.8 0 0]' b = [0 6 0]' c = [0 0 4.5]' ab = b-a ac = c-a n = cross(ab,ac) en = n/sqrt(n'*n) % Test ob a,b,c alle in derselben Ebene dista = en'*a distb = en'*b distc = en'*c
ay = [4 0 1]' by = [4 4 1]' cy = [2 2 1]' P0 = [ay by cy ay] T1 = [1 0 -4 ; 0 1 -4; 0 0 1] T2 = [0 -1 0 ; 1 0 0; 0 0 1] T3 = [1 0 4 ; 0 1 4; 0 0 1] P1 = T1*P0 P2 = T2*P1 % transformierte Punkte P3 = T3*P2 % Gesamt Transformationsmatrix TT = T3*T2*T1 % Transformierte Punkte mit TT P3b = TT*P0 % Plot Urbild schwarz, Schlussbild rot plothclin(P0,'k') stdhcaxis hold on plothclin(P1,'b') plothclin(P2,'g') plothclin(P3,'r')
w = (0:0.01:5)*2*pi y = w*2/(2*pi) % W*Ganghoehe/(2*pi) z = 4*cos(w) xr = 4*sin(w) xl = -4*sin(w) plot3(xr,y,z,'r') hold on plot3(xl,y,z,'k') % Achsenkreuz plot3([0 0], [0 10], [0 0],'g') plot3([0 5], [0 0], [0 0],'g') plot3([0 0], [0 0], [0 5],'g') axis([-5 5 0 10 -5 5]) axis square % Kreuzungspunkte zwischen links und rechtsdrehender Helix wm = (0:0.5:5)*2*pi ym = wm*2/(2*pi) zm = 4*cos(wm) xm = 4*sin(wm) plot3(xm,ym,zm,'bo')