欢迎来到天天文库
浏览记录
ID:28144303
大小:121.30 KB
页数:16页
时间:2018-12-07
《机械原理实验vb程序》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、PrivateSubCommandl_Click()DimLl,L2,L3,L4AsDoubleDimsl_Degree,s2_Degree,s3_Degree,sl,s2,s3AsDoubleDimwl,w2,w3AsDoubleDimal,a2,a3AsDoubleDimA,B,CAsDoubleDimiAsIntegerpi=3.1415926LI=Val(Textl.Text)L2=Val(Text2.Text)L3=Val(Text3.Text)L4=Val(Text4.Text)wl=Val(Text5.Text)Text6.Text=Text6.Tex
2、t&’’si’’&n’’&ns2”&n&"s3n&Chr(13)&Chr(10)Text7.Text=Text7.Text&”wl”&n”&nw2”&”&nw3n&Chr(13)&Chr(10)Text8.Text=Text8.Text&aln&”n&na2’’&n&Ha3n&Chr(13)&Chr(10)i=0Forsi—Degree=0To360Step30si=sl_Degree*pi/180A=L4-LI*Cos(sl)B=-L1*Sin(sl)C=(A八2+B八2+L3八2-L2八2)/(2*L3)s3=2*Atn((B+Sqr(A*A+B*B-C*C))
3、/(A-C))s2=Atn((B+L3*Sin(s3))/(A+L3*Cos(s3)))s2_Degree=s2*180/pis3_Degree=s3*180/piw3=wl*((LI*Sin(sl-s2))/(L3*Sin(s3-s2)))w2=-wl*((LI*Sin(sl-s3))/(L2*Sin(s2-s3)))al=0a3=(L2*w2*w2+LI*wl*wl*Cos(sl-s2)-L3*w3*w3*Cos(s3-s2))/(L3*Sin(s3-s2))a2=(L3*w3*w3-LI*wl*wl*Cos(sl-s3)-L2*w2*w2*Cos(s2-s3)
4、)/(L2*Sin(s2-s3))Text6.Text=Text6.Text&Format(sl—Degree,’’0.000’’)&’’&Format(s2一Degree,’’0.000’’)&&Format(s3_Degree,’’0.000”)&Chr(13)&Chr(10)Text7.Text=Text7.Text&Format(w1,"0.0001’)&’’&Format(w2,n0.000n)&””&Format(w3,n0.000n)&Chr(13)&Chr(10)&Format(a3,”0.000”)&Chr(13)Format(a2,”0.000”
5、)&&Chr(10)Nexts1_DegreeEndSubPrivateSubCommand2_Click()UnloadFormlEndSubPrivateSubCommand1_Click()Dimpl,p2,p3AsDoubleDime,rb,rr,hAsDoubleDims,sOAsDoubleDimx,y,xl,yl,dxdp,dydpAsDoublepi=3.1415926e=Val(Text1.Text)rb=Val(Text2.Text)rr=Val(Text3.Text)h=Val(Text4.Text)pi=Val(Text5.Text)p2=V
6、al(Text6.Text)p3=Val(Text7.Text)Text8.Text=Text8.Text&HDM&nn&Hxn&H”&&”&nxln&n’’&”yl”&Chr(13)&Chr(10)sO=Sqr(rb*rb-e*e)DimTheat_DegAsIntegerForTheat一Deg=0To360Step30If(Theat_Deg〉=0AndTheat一Deg<=pi)Thens=h*Theat_Deg/p1Theat_Rad=Theat_Deg*pi/180x=(sO+s)*Sin(Theat_Rad)+e*Cos(Theat_Rad)y=(sO
7、+s)*Cos(Theat_Rad)-e*Sin(Theat_Rad)dxdp=(sO+s)*Cos(Theat_Rad)-e*Sin(Theat_Rad)dydp=-(sO+s)*Sin(Theat_Rad)-e*Cos(Theat_Rad)xl=x+rr*(dydp/Sqr(dxdp*dxdp+dydp*dydp))yl=y-rr*(dxdp/Sqr(dxdp*dxdp+dydp*dydp))Elself(Theat_Deg>p1AndTheat_Deg<=p2)Thens=hTheat一Rad=Theat一Deg*pi/180x=(sO+s)*Sin(Th
此文档下载收益归作者所有