n=5 D = zeros(3*n) for zei = 1:3*n for spa = zei:min(zei-n+1,3*n) D(zei,spa) = 3 end end spy(D)
a = [12 0 0]' b = [0 9.6 0]' c = [0 0 9]' 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 6 1]' cy = [1 3 1]' P0 = [ay by cy ay] T1 = [1 0 -4 ; 0 1 -6; 0 0 1] T2 = [0 1 0 ; -1 0 0; 0 0 1] T3 = [1 0 4 ; 0 1 6; 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 x = w*2/(2*pi) % W*Ganghoehe/(2*pi) z = 3*cos(w) yr = 3*sin(w) yl = -3*sin(w) plot3(x,yr,z,'r') hold on plot3(x,yl,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 = 3*cos(wm) xm = 3*sin(wm) plot3(xm,ym,zm,'bo')