2007年4月11日 星期三

hw5-2

四指同時的圖
食指

中指


小拇指

無名指


第一個程式

function finger(F,th1,th2,th3)

PALMLENGTH=F;

L=6/19*PALMLENGTH; %訂出三節手指與手掌之比例

L1=27/95*PALMLENGTH;

L2=5/19*PALMLENGTH;

Ax=[0 L/3 L/2 2*L/3 L 2*L/3 L/2 L/3 0];

Ay=[0 L/16 4*L/65 L/16 0 -L/16 -4*L/65 -L/16 0];

Bx=[0 L1/3 L1/2 2*L1/3 L1 2*L1/3 L1/2 L1/3 0];

By=[0 L1/20 L1/18 L1/20 0 -L1/20 -L1/18 -L1/20 0];

Cx=[0 L2/3 2*L2/3 L2 2*L2/3 L2/3 0];

Cy=[0 L2/17 L2/15 0 -L2/15 -L2/17 0];

axis equalline(Ax,Ay);

line(Bx+L,By);

line(Cx+L+L1,Cy);

clf

axis equal

AXIS([-15 15 -15 15]);
X1=Ax*cosd(-th1)-Ay*sind(-th1);

Y1=Ax*sind(-th1)+Ay*cosd(-th1);

line(X1,Y1)

th2=180+th1-th2;

X2=Bx*cosd(-th2)-By*sind(-th2)+X1(5);

Y2=Bx*sind(-th2)+By*cosd(-th2)+Y1(5);

line(X2,Y2)

th3=180+th2-th3;

X3=Cx*cosd(-th3)-Cy*sind(-th3)+X2(5);

Y3=Cx*sind(-th3)+Cy*cosd(-th3)+Y2(5);

line(X3,Y3)

axis equal





第二個程式

function finger2(F,th1,th2,th3)

PALMLENGTH=F;

L=6/16*PALMLENGTH %訂出三節手指與手掌之比例
L1=25/90*PALMLENGTH
L2=3/16*PALMLENGTH

Ax=[0 L/3 L/2 2*L/3 L 2*L/3 L/2 L/3 0];
Ay=[0 L/16 4*L/65 L/16 0 -L/16 -4*L/65 -L/16 0];
Bx=[0 L1/3 L1/2 2*L1/3 L1 2*L1/3 L1/2 L1/3 0];
By=[0 L1/20 L1/18 L1/20 0 -L1/20 -L1/18 -L1/20 0];
Cx=[0 L2/3 2*L2/3 L2 2*L2/3 L2/3 0];
Cy=[0 L2/17 L2/15 0 -L2/15 -L2/17 0];

axis equal

line(Ax,Ay);
line(Bx+L,By);
line(Cx+L+L1,Cy);

axis equal

AXIS([-15 15 -15 15]);
X1=Ax*cosd(-th1)-Ay*sind(-th1);
Y1=Ax*sind(-th1)+Ay*cosd(-th1);
line(X1,Y1)

th2=180+th1-th2;

X2=Bx*cosd(-th2)-By*sind(-th2)+X1(5);
Y2=Bx*sind(-th2)+By*cosd(-th2)+Y1(5);
line(X2,Y2)

th3=180+th2-th3;
X3=Cx*cosd(-th3)-Cy*sind(-th3)+X2(5);
Y3=Cx*sind(-th3)+Cy*cosd(-th3)+Y2(5);
line(X3,Y3)
axis equal


第三個程式
function finger3(F,th1,th2,th3)
PALMLENGTH=F;
L=10/19*PALMLENGTH %訂出三節手指與手掌之比例
L1=22/95*PALMLENGTHL2=5/16*PALMLENGTH
Ax=[0 L/3 L/2 2*L/3 L 2*L/3 L/2 L/3 0];
Ay=[0 L/16 4*L/65 L/16 0 -L/16 -4*L/65 -L/16 0];

Bx=[0 L1/3 L1/2 2*L1/3 L1 2*L1/3 L1/2 L1/3 0];
By=[0 L1/20 L1/18 L1/20 0 -L1/20 -L1/18 -L1/20 0];

Cx=[0 L2/3 2*L2/3 L2 2*L2/3 L2/3 0];
Cy=[0 L2/17 L2/15 0 -L2/15 -L2/17 0];

axis equal
line(Ax,Ay);
line(Bx+L,By);
line(Cx+L+L1,Cy);
axis equal

AXIS([-15 15 -15 15]);
X1=Ax*cosd(-th1)-Ay*sind(-th1);
Y1=Ax*sind(-th1)+Ay*cosd(-th1);
line(X1,Y1)

th2=180+th1-th2;
X2=Bx*cosd(-th2)-By*sind(-th2)+X1(5);
Y2=Bx*sind(-th2)+By*cosd(-th2)+Y1(5);
line(X2,Y2)

th3=180+th2-th3;
X3=Cx*cosd(-th3)-Cy*sind(-th3)+X2(5);
Y3=Cx*sind(-th3)+Cy*cosd(-th3)+Y2(5);
line(X3,Y3)
axis equal




第四個程式
function finger4(F,th1,th2,th3)
PALMLENGTH=F;
L=6/15*PALMLENGTH %訂出三節手指與手掌之比例
L1=27/90*PALMLENGTH
L2=5/15*PALMLENGTH

Ax=[0 L/3 L/2 2*L/3 L 2*L/3 L/2 L/3 0];
Ay=[0 L/16 4*L/65 L/16 0 -L/16 -4*L/65 -L/16 0];
Bx=[0 L1/3 L1/2 2*L1/3 L1 2*L1/3 L1/2 L1/3 0];
By=[0 L1/20 L1/18 L1/20 0 -L1/20 -L1/18 -L1/20 0];
Cx=[0 L2/3 2*L2/3 L2 2*L2/3 L2/3 0];
Cy=[0 L2/17 L2/15 0 -L2/15 -L2/17 0];

axis equal
line(Ax,Ay);
line(Bx+L,By);
line(Cx+L+L1,Cy);
axis equal

AXIS([-15 15 -15 15]);
X1=Ax*cosd(-th1)-Ay*sind(-th1);
Y1=Ax*sind(-th1)+Ay*cosd(-th1);
line(X1,Y1)

th2=180+th1-th2;
X2=Bx*cosd(-th2)-By*sind(-th2)+X1(5);
Y2=Bx*sind(-th2)+By*cosd(-th2)+Y1(5);
line(X2,Y2)th3=180+th2-th3;

X3=Cx*cosd(-th3)-Cy*sind(-th3)+X2(5);
Y3=Cx*sind(-th3)+Cy*cosd(-th3)+Y2(5);
line(X3,Y3)
axis equal




畫出來的程式
theta1=linspace(0,90,10)
theta2=linspace(180,90,10)
theta3=linspace(0,270,10)

for n=1:10
finger(9.5,theta1(n),theta2(n),theta3(n))end;


-------
以物理學過的方法解此題 :
在投球時候,會產生加速度
向心加速度an=w^2/r
切線加速度at=a*r
(w--角速度 r--手指長 a--角加速度)

沒有留言: