b94611032 生機二 張鈞崴
4.1
x=[0 42 42*cosd(60) 0];y=[0 0 42*sind(60) 0];line(x,y);for d=0:30:360x1 = x*cosd(d)+y*sind(d);y1 =-x*sind(d)+y*cosd(d);x2=42+x1;x3=x1+42*cosd(60);y3=y1+42*sind(60);line(x1,y1,'erasemode','xor','color','k');line(x2,y1,'erasemode','xor','color','r');line(x3,y3,'erasemode','xor','color','y');axis equal;pause(0.5);end;
4.1
x=[0 42 42*cosd(60) 0];y=[0 0 42*sind(60) 0];line(x,y);for d=0:30:360x1 = x*cosd(d)+y*sind(d);y1 =-x*sind(d)+y*cosd(d);x2=42+x1;x3=x1+42*cosd(60);y3=y1+42*sind(60);line(x1,y1,'erasemode','xor','color','k');line(x2,y1,'erasemode','xor','color','r');line(x3,y3,'erasemode','xor','color','y');axis equal;pause(0.5);end;
4.2
圖示4.2
x=[0 10 10 0 0];y=[2 2 -2 -2 2];for i=0:30:360 x1=x*cosd(i)+y*sind(i); y1=-x*sind(i)+y*cosd(i); Ys=[10*sind(i) 0]; Xs=[10*cosd(i) 15]; line(x1,y1); line(Xs,Ys); axis equal; pause(0.5); end;
圖示4.2
x=[0 10 10 0 0];y=[2 2 -2 -2 2];for i=0:30:360 x1=x*cosd(i)+y*sind(i); y1=-x*sind(i)+y*cosd(i); Ys=[10*sind(i) 0]; Xs=[10*cosd(i) 15]; line(x1,y1); line(Xs,Ys); axis equal; pause(0.5); end;