2007年6月2日 星期六

第四次作業

1.

L=39+10
X=[0 49 49/2 0]
Y=[0 0 49*cosd(30) 0]
HELLO=line(X,Y)
AXIS([-100 100 -100 100])
for n=1:180
rotate(HELLO,[0 0 1],2,[0 0 0])
pause(0.005)
end;
for n=1:180
rotate(HELLO,[0 0 1],2,[49 0 0])
pause(0.005)
end;
for n=1:180
rotate(HELLO,[0 0 1],2,[49/2 49*cosd(30) 0])
pause(0.005)
end;
xlabel('x');
ylabel('y')


2.

for n = 0:8
linkshape([5*cosd(45*n) 5*sind(45*n)],[15*cosd(45*n) 15*sind(45*n)],4);
linkshape([15 0],[15*cosd(45*n) 15*sind(45*n)]); end


3.

linkshape([0 0],[10 0],2)
linkshape([0 0],[3 4],3)
linkshape([3 4],[13 4],1.5)
linkshape([13 4],[10 0],2)
AXIS([-20 20 -8 8])
A=[0 0]D=[10 0]
linkshape(A,D,2)
for n=[1:12]
X=[3*cosd(30*n)-4*sind(30*n)]
Y=[3*sind(30*n)+4*cosd(30*n)]
x=[3*cosd(30*n)-4*sind(30*n)+10]
y=[3*sind(30*n)+4*cosd(30*n)]
linkshape(A,[X Y],3)
linkshape([X Y],[x y],1.5)
linkshape([x y],D,2)
axis equal
pause(0.5)
end

沒有留言: