2007年4月13日 星期五

5.1
1.
2.
3.
我的上手臂長30公分
下手臂25公分
手掌長18公分
依題意輸入(-90, -45, 210 度)

L1 = input('請輸入上手臂長:(單位:公分)');
L2 = input('請輸入下手臂長:(單位:公分)');
L3 = input('請輸入手掌長:(單位:公分)');
theta1 = input('請輸入上手臂與X軸正交角:(單位:度)');
theta2 = input('請輸入下手臂與下手臂正交角:(單位:度)');
theta2 = theta2 - 180;
theta3 = input('請輸入手掌與下手臂正交角:(單位:度)');
theta3 = theta3 -180;

k = 1 / L1
angle = acos(k) / pi*180
phi = angle:1:angle+360
x1 = cosd(phi)
y1 = sind(phi)
x2 = 5 * cosd(angle) %上端半徑5公分
y2 = 5 * sind(angle)
phip = angle:1:360-angle
x3 = 5 * cosd(phip)
y3 = 5 * sind(phip)
x4 = L1 + 4 * cosd(angle) %下端半徑4公分
y4 = 4 * sind(-angle)
phipp = -angle:1:angle
x5 = L1 + 4*cosd(phipp)
y5 = 4 * sind(phipp)
x6 = L1 + k
y6 = sind(angle)
phippp = angle:1:angle+360
x7 = cosd(phippp) + L1
y7 = sind(phippp)
x8 = L1 + 4 * cosd(angle)
y8 = 4 * sind(angle)

s = 1 / L2
angle2 = acos(s) / pi*180
phi2 = angle2:1:angle2+360
x12 = cosd(phi2)+L1
y12 = sind(phi2)
x22 = 4 * cosd(angle2) + L1 %上端半徑4公分
y22 = 4 * sind(angle2)
phip2 = angle2 : 1 : 360-angle2
x32 = 4 * cosd(phip2) + L1
y32 = 4 * sind(phip2)
x42 = L1 + L2 + 3 * cosd(angle2) %下端半徑3公分
y42 = 3 * sind(-angle2)
phipp2 = -angle2 : 1 : angle2
x52 = L1 + L2 + 3 * cosd(phipp2)
y52 = 3 * sind(phipp2)
x62 = L1 + L2 + s
y62 = sind(angle2)
phippp2 = angle2:1:angle2+360
x72 = cosd(phippp2) + L1 + L2
y72 = sind(phippp2)
x82 = L1 + L2 + 3 * cosd(angle2)
y82 = 3 * sind(angle2)

phi3 = 90:1:450
x13 = cosd(phi3) + L1 + L2
y13 = sind(phi3)
x23 = L1 + L2
y23 = 3 %手掌寬3公分
x33 = 3*cosd(phi3) + L1 + L2
y33 = 3*sind(phi3)
x43 = L3*2/3 + L1 + L2
y43 = 3
x53 = 1.5*(3^0.5) + L1 + L2
y53 = 1.5
x63 = L3*8/9 + 1.5*(3^0.5) + L1 + L2
y63 = 1.5
x73 = L1 + L2 + 3
y73 = 0
x83 = L1 + L2 + L3 +3
y83 = 0
x93 = 1.5*(3^0.5) + L1 + L2
y93 = -1.5
x103 = L3*8/9 + 1.5*(3^0.5) + L1 + L2
y103 = -1.5
x113 = 1.5*(2^0.5) + L1 + L2
y113 = -1.5*(2^0.5)
x123 = (1.5 + L3*1/3)*(2^0.5) + L1 + L2
y123 = -(1.5 + L3*1/3)*(2^0.5)



X =[x1 x2 x3 x4 x5 x6 x7 x8 x2]
Y =[y1 y2 y3 y4 y5 y6 y7 y8 y2]
X2 =[x12 x22 x32 x42 x52 x62 x72 x82 x22]
Y2 =[y12 y22 y32 y42 y52 y62 y72 y82 y22]
X3 =[x13 x23 x33 x43 x33 x53 x63 x53 x73 x83 x73 x93 x103 x93 x113 x123]
Y3 =[y13 y23 y33 y43 y33 y53 y63 y53 y73 y83 y73 y93 y103 y93 y113 y123]

Arm1 = [X' Y']
Arm2 = [X2' Y2']
Arm3 = [X3' Y3']
axis equal
axis([-10 35 -40 10])
hold on
up = line(Arm1(:,1),Arm1(:,2))
down = line(Arm2(:,1),Arm2(:,2))
hand = line(Arm3(:,1),Arm3(:,2))


for i=1:1:1
rotate(up,[0 0 1],theta1,[0 0 0])
rotate(down,[0 0 1],theta1,[0 0 0])
rotate(hand,[0 0 1],theta1,[0 0 0])
for ii=1:1:1
m = L1 * cosd(i*theta1)
n = L1 * sind(i*theta1)
rotate(down,[0 0 1],theta2,[m n 0])
rotate(hand,[0 0 1],theta2,[m n 0])
for iii=1:1:1
p = L1 * cosd(i*theta1) + L2 * cosd(ii*(theta1+theta2))
q = L1 * sind(i*theta1) + L2 * sind(ii*(theta1+theta2))
rotate(hand,[0 0 1],theta3,[p q 0])
end
end
end
圖示

4.
我的上手臂長30公分
下手臂25公分
手掌長18公分
依題意輸入(-90~-75, -45~-35, 210~190 度)

L1 = input('請輸入上手臂長:(單位:公分)');
L2 = input('請輸入下手臂長:(單位:公分)');
L3 = input('請輸入手掌長:(單位:公分)');
theta1s = input('請輸入原始上手臂與X軸正交角:(單位:度)');
theta1f = input('請輸入最終上手臂與X軸正交角:(單位:度)');
theta2s = input('請輸入原始下手臂與下手臂正交角:(單位:度)');
theta2f = input('請輸入最終下手臂與下手臂正交角:(單位:度)');
theta2s = theta2s - 180;
theta2f = theta2f - 180;
theta3s = input('請輸入原始手掌與下手臂正交角:(單位:度)');
theta3f = input('請輸入最終手掌與下手臂正交角:(單位:度)');
theta3s = theta3s -180;
theta3f = theta3f -180;

k = 1 / L1
angle = acos(k) / pi*180
phi = angle:1:angle+360
x1 = cosd(phi)
y1 = sind(phi)
x2 = 5 * cosd(angle) %上端半徑5公分
y2 = 5 * sind(angle)
phip = angle:1:360-angle
x3 = 5 * cosd(phip)
y3 = 5 * sind(phip)
x4 = L1 + 4 * cosd(angle) %下端半徑4公分
y4 = 4 * sind(-angle)
phipp = -angle:1:angle
x5 = L1 + 4*cosd(phipp)
y5 = 4 * sind(phipp)
x6 = L1 + k
y6 = sind(angle)
phippp = angle:1:angle+360
x7 = cosd(phippp) + L1
y7 = sind(phippp)
x8 = L1 + 4 * cosd(angle)
y8 = 4 * sind(angle)

s = 1 / L2
angle2 = acos(s) / pi*180
phi2 = angle2:1:angle2+360
x12 = cosd(phi2)+L1
y12 = sind(phi2)
x22 = 4 * cosd(angle2) + L1 %上端半徑4公分
y22 = 4 * sind(angle2)
phip2 = angle2 : 1 : 360-angle2
x32 = 4 * cosd(phip2) + L1
y32 = 4 * sind(phip2)
x42 = L1 + L2 + 3 * cosd(angle2) %下端半徑3公分
y42 = 3 * sind(-angle2)
phipp2 = -angle2 : 1 : angle2
x52 = L1 + L2 + 3 * cosd(phipp2)
y52 = 3 * sind(phipp2)
x62 = L1 + L2 + s
y62 = sind(angle2)
phippp2 = angle2:1:angle2+360
x72 = cosd(phippp2) + L1 + L2
y72 = sind(phippp2)
x82 = L1 + L2 + 3 * cosd(angle2)
y82 = 3 * sind(angle2)

phi3 = 90:1:450
x13 = cosd(phi3) + L1 + L2
y13 = sind(phi3)
x23 = L1 + L2
y23 = 3 %手掌寬3公分
x33 = 3*cosd(phi3) + L1 + L2
y33 = 3*sind(phi3)
x43 = L3*2/3 + L1 + L2
y43 = 3
x53 = 1.5*(3^0.5) + L1 + L2
y53 = 1.5
x63 = L3*8/9 + 1.5*(3^0.5) + L1 + L2
y63 = 1.5
x73 = L1 + L2 + 3
y73 = 0
x83 = L1 + L2 + L3 +3
y83 = 0
x93 = 1.5*(3^0.5) + L1 + L2
y93 = -1.5
x103 = L3*8/9 + 1.5*(3^0.5) + L1 + L2
y103 = -1.5
x113 = 1.5*(2^0.5) + L1 + L2
y113 = -1.5*(2^0.5)
x123 = (1.5 + L3*1/3)*(2^0.5) + L1 + L2
y123 = -(1.5 + L3*1/3)*(2^0.5)



X =[x1 x2 x3 x4 x5 x6 x7 x8 x2]
Y =[y1 y2 y3 y4 y5 y6 y7 y8 y2]
X2 =[x12 x22 x32 x42 x52 x62 x72 x82 x22]
Y2 =[y12 y22 y32 y42 y52 y62 y72 y82 y22]
X3 =[x13 x23 x33 x43 x33 x53 x63 x53 x73 x83 x73 x93 x103 x93 x113 x123]
Y3 =[y13 y23 y33 y43 y33 y53 y63 y53 y73 y83 y73 y93 y103 y93 y113 y123]

Arm1 = [X' Y']
Arm2 = [X2' Y2']
Arm3 = [X3' Y3']
axis equal
axis([-10 35 -40 10])
hold on
up = line(Arm1(:,1),Arm1(:,2))
down = line(Arm2(:,1),Arm2(:,2))
hand = line(Arm3(:,1),Arm3(:,2))

ia = (theta1f-theta1s)/10
iia = (theta2f-theta2s)/10
iiia = (theta3f-theta3s)/10

rotate(up,[0 0 1],theta1s,[0 0 0])
rotate(down,[0 0 1],theta1s,[0 0 0])
rotate(hand,[0 0 1],theta1s,[0 0 0])
m = L1 * cosd(theta1s)
n = L1 * sind(theta1s)
rotate(down,[0 0 1],theta2s,[m n 0])
rotate(hand,[0 0 1],theta2s,[m n 0])
p = L1 * cosd(theta1s) + L2 * cosd(theta1s+theta2s)
q = L1 * sind(theta1s) + L2 * sind(theta1s+theta2s)
rotate(hand,[0 0 1],theta3s,[p q 0])
for i=1:1:10
rotate(up,[0 0 1],ia,[0 0 0])
rotate(down,[0 0 1],ia,[0 0 0])
rotate(hand,[0 0 1],ia,[0 0 0])
pause(0.01)
m = L1 * cosd(i*ia+theta1s)
n = L1 * sind(i*ia+theta1s)
rotate(down,[0 0 1],iia,[m n 0])
rotate(hand,[0 0 1],iia,[m n 0])
pause(0.01)
p = L1 * cosd(i*ia + theta1s) + L2 * cosd(theta1s + i*ia + theta2s + i*iia )
q = L1 * sind(i*ia + theta1s) + L2 * sind(theta1s + i*ia + theta2s + i*iia )
rotate(hand,[0 0 1],iiia,[p q 0])
pause(0.01)
end
動畫張貼於部落格


5.2
1.
分析手指關節,則會發現手指關節只有一方向之自由度,即繞Z軸方向旋轉。而旋轉的角度
亦被關節結構所限制,只能同方向(攤開手掌,往掌心旋轉)旋轉約90度。以下為我分析所寫
的程式

L1 = 2.5 %第三指結為2.5公分
phi = 90:1:450
x11 = 0.2*cosd(phi)
y11 = 0.2*sind(phi)
x12 = 0
y12 = 1 %手指寬為1公分
phip = 90:1:270
x13 = 1 * cosd(phip)
y13 = 1 * sind(phip)
x14 = L1
y14 = -1
phipp = 270:1:450
x15 = L1 + 1*cosd(phipp)
y15 = 1 * sind(phipp)
x16 = L1
y16 = 0.2
x17 = 0.2*cosd(phi) + L1
y17 = 0.2*sind(phi)
x18 = L1
y18 = 1
X1 = [x11 x12 x13 x14 x15 x16 x17 x16 x18 x12]
Y1 = [y11 y12 y13 y14 y15 y16 y17 y16 y18 y12]
F1 = [X1' Y1']

L2 = 2.4 %第二指節長2.4公分
x21 = 0.2*cosd(phi) + L1
y21 = 0.2*sind(phi)
x22 = L1
y22 = 1
x23 = 1 * cosd(phip) + L1
y23 = 1 * sind(phip)
x24 = L2 + L1
y24 = -1
x25 = L2 + 1*cosd(phipp) + L1
y25 = 1 * sind(phipp)
x26 = L2 + L1
y26 = 0.2
x27 = 0.2*cosd(phi) + L2 + L1
y27 = 0.2*sind(phi)
x28 = L2 + L1
y28 = 1
X2 = [x21 x22 x23 x24 x25 x26 x27 x26 x28 x22]
Y2 = [y21 y22 y23 y24 y25 y26 y27 y26 y28 y22]

L3 = 2.6 %第三指節長2.6公分
x31 = 0.2*cosd(phi) + L1 + L2
y31 = 0.2*sind(phi)
x32 = L1 + L2
y32 = 1
x33 = 1 * cosd(phip) + L1 + L2
y33 = 1 * sind(phip)
x34 = L1 + L2 + L3
y34 = -1
x35 = L1 + 1*cosd(phipp) + L2 + L3
y35 = 1 * sind(phipp)
x36 = L1 + L2 + L3
y36 = 0.2
x37 = 0.2*cosd(phi) + L1 + L2 + L3
y37 = 0.2*sind(phi)
x38 = L1 + L2 + L3
y38 = 1
X3 = [x31 x32 x33 x34 x35 x36 x37 x36 x38 x32]
Y3 = [y31 y32 y33 y34 y35 y36 y37 y36 y38 y32]
F3 = [X3' Y3']
F2 = [X2' Y2']
Finger1 = line(F1(:,1),F1(:,2))
Finger2 = line(F2(:,1),F2(:,2))
Finger3 = line(F3(:,1),F3(:,2))
axis equal
axis ([-4 10 -4 10])
for i = 1:1:90
rotate(Finger3,[0 0 1],1,[L1+L2 0 0])
pause(0.01)
end
for i = 1:1:90 %模擬伸直之手只向掌心彎曲
rotate(Finger2,[0 0 1],1,[L1 0 0])
rotate(Finger3,[0 0 1],1,[L1 0 0])
pause(0.01)
end
for i = 1:1:90
rotate(Finger1,[0 0 1],1,[0 0 0])
rotate(Finger2,[0 0 1],1,[0 0 0])
rotate(Finger3,[0 0 1],1,[0 0 0])
pause(0.01)
end

動畫張貼於部落格


2.
同上述之程式,考慮每隻指頭之相對位置,模擬四隻指頭從攤平至握拳的情形
食指為藍色
中指為紅色
無名指為黑色
小指為綠色

動畫張貼於部落格


3.
假設棒球投之球速為160 km/h,手指末端速度即為球速,不考慮其他阻力與人體工學所造成的障礙。
投手的手指指節長分別為2.4、2.6、2.5公分。根據投球姿勢:出手時,手指第一指節應為水平(0度);
第二指節約為30度;第三指節約為45度。依照上述條件,所計算出的結果為436 cm/s,即手指以每秒約
4.6公尺投球。
而假設手指在出手時,三指指節角速度分別約為2pi pi pi/2,角加速度約為8pi 4pi 2pi,則經過計算
結果,加速度約為26 cm/s,即為2.6 m/s的加速度。

沒有留言: