大三机械设计方案课程设计方案vb
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Private Sub Command1_Click(Index As Integer)
Dim dblWP As Double, dblHP As Double, i As Integer
dblWP = Abs(Picture1(0).ScaleWidth)
dblHP = Abs(Picture1(0).ScaleHeight)
For i = 0 To 5
Picture1(i).Cls
Picture1(i).ScaleMode = 1
Picture1(i).DrawStyle = 0
Picture1(i).DrawWidth = 1.5
Picture1(i).Scale (-120, dblHP / 2)-(dblWP - 120, -dblHP / 2)
Picture1(i).Line (0, 0)-(dblWP - 160, 0)
Picture1(i).Line (dblWP - 160, 0)-Step(-120, 120)
Picture1(i).Line (dblWP - 160, 0)-Step(-120, -120) Picture1(i).CurrentX = dblWP - 700
Picture1(i).CurrentY = 250
Picture1(i).Print "f_AB"
Picture1(i).CurrentX = -120
Picture1(i).CurrentY = -10
Picture1(i).Print "0"
Picture1(i).Line (0, dblHP / 2 - 60)-(0, -(dblHP / 2 - 60)) Picture1(i).Line (0, dblHP / 2 - 60)-Step(-120, -120) Picture1(i).Line (0, dblHP / 2 - 60)-Step(120, -120) Picture1(i).CurrentX = 160
Picture1(i).CurrentY = dblHP / 2 - 60
If i <> 0 Then Picture1(i).FontName = "ms sans serif"
Select Case i
Case 0
Picture1(i).Print "f_CD"
Case 1
Picture1(i).Print "w_CD"
Case 2
Picture1(i).Print "e_CD"
Case 3
Picture1(i).Print "s_E"
Case 4
Picture1(i).Print "v_E"
Case 5
Picture1(i).Print "a_E"
End Select
Next i
Dim dblMax_f_CD As Double, dblMax_w_CD As Double, dblMax_e_CD As Double
Dim dblMax_s_E As Double, dblMax_v_E As Double, dblMax_a_E As Double
Dim dblF_CD, dblW_CD, dblE_CD As Double
Dim dblS_E, dblV_E, dblA_E As Double
Dim dblF_AB, dblF_DE As Double
Dim dblAB As Double, dblCD As Double, dblDE As Double, dblAC As Double, dblH As Double, dblSE As Double, dbldf_CD As Double
Dim PI As Double PI = 3.1415926
dblAB = Val(Form1.Text1.Text) dblCD = Val(Form1.Text2.Text) dblDE =
Val(Form1.Text3.Text) dblAC = Val(Form1.Text4.Text) dblH = Val(Form1.Text5.Text) dbln1 = Val(Form1.Text6.Text) For i = 0 To 360
dblF_AB = i * PI / 180
dblF_CD = Atn((dblAC + dblAB * Sin(dblF_AB)) / (dblAB * Cos(dblF_AB)))
If dblF_CD < 0 Then dblF_CD = dblF_CD + PI dblW_CD = dblAB * (2 * PI * dbln1 / 60) * Cos(dblF_AB - dblF_CD) / Sqr(Abs(dblAB * dblAB + dblAC * dblAC + 2 * dblAC * dblAB * Sin(dblF_AB)))
dblE_CD = (-dblAB * (2 * PI * dbln1 / 60) * (2 * PI * dbln1 / 60) * Sin(dblF_AB - dblF_CD) + 2 * dblAB * (2 * PI * dbln1 / 60) * Sin(dblF_AB - dblF_CD) * dblW_CD) / Sqr(Abs(dblAB * dblAB + dblAC * dblAC + 2 * dblAC * dblAB * Sin(dblF_AB)))
dblF_DE = Atn(((dblH - dblCD * Sin(dblF_CD)) / dblDE) / Sqr(Abs(1 - (dblH - dblCD *
Sin(dblF_CD)) * (dblH - dblCD * Sin(dblF_CD)) / (dblDE * dblDE))))
dblw_DE = (-(dblCD * dblW_CD * Cos(dblF_CD)) / (dblDE * Cos(dblF_DE))) dble_DE = ((dblDE * dblw_DE * dblw_DE * Sin(dblF_DE)) + dblCD * dblW_CD * dblW_CD *
Sin(dblF_CD) - dblCD * dblE_CD * Cos(dblF_CD)) / (dblDE * Cos(dblF_DE)) dblS2 = Sqr(dblAB * dblAB + dblAC * dblAC + 2 * dblAC * dblAB * Sin(dblF_AB))
dblS_E = dblCD * Cos(dblF_CD) + dblDE * Cos(dblF_DE)
dblV_E = (-dblCD / 1000) * dblW_CD * Sin(dblF_CD) - (dblDE / 1000) * (-(dblCD / 1000)
* dblW_CD * Cos(dblF_CD) / ((dblDE / 1000) * Cos(dblF_DE))) * (((dblH / 1000) - (dblCD /
1000) * Sin(dblF_CD)) / (dblDE / 1000))