大三機械設計課程設計vb_第1頁
大三機械設計課程設計vb_第2頁
大三機械設計課程設計vb_第3頁
大三機械設計課程設計vb_第4頁
大三機械設計課程設計vb_第5頁
已閱讀5頁,還剩2頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領

文檔簡介

1、 Private Sub Command1_Click(Index As Integer)Dim dblWP As Double, dblHP As Double, i As IntegerdblWP = Abs(Picture1(0).ScaleWidth)dblHP = Abs(Picture1(0).ScaleHeight)For i = 0 To 5Picture1(i).ClsPicture1(i).ScaleMode = 1Picture1(i).DrawStyle = 0Picture1(i).DrawWidth = 1.5Picture1(i).Scale (-120, dbl

2、HP / 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 - 700Picture1(i).CurrentY = 250Picture1(i).Print "f_AB"Picture1(i).CurrentX = -120Picture

3、1(i).CurrentY = -10Picture1(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 = 160Picture1(i).CurrentY = dblHP / 2 - 60If i <> 0 Then Pic

4、ture1(i).FontName = "ms sans serif"Select Case iCase 0Picture1(i).Print "f_CD"Case 1Picture1(i).Print "w_CD"Case 2Picture1(i).Print "e_CD"Case 3Picture1(i).Print "s_E"Case 4Picture1(i).Print "v_E"Case 5Picture1(i).Print "a_E"End S

5、electNext iDim dblMax_f_CD As Double, dblMax_w_CD As Double, dblMax_e_CD As DoubleDim dblMax_s_E As Double, dblMax_v_E As Double, dblMax_a_E As DoubleDim dblF_CD, dblW_CD, dblE_CD As DoubleDim dblS_E, dblV_E, dblA_E As DoubleDim dblF_AB, dblF_DE As DoubleDim dblAB As Double, dblCD As Double, dblDE A

6、s Double, dblAC As Double, dblH As Double, dblSE As Double, dbldf_CD As DoubleDim PI As DoublePI = 3.1415926dblAB = 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 db

7、lF_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 * P

8、I * 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(dbl

9、F_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

10、 + 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) / (d

11、blDE / 1000) dblA_E = (-dblCD / 1000) * dblE_CD * Sin(dblF_CD) - (dblCD / 1000) * dblW_CD * dblW_CD * Cos(dblF_CD) - (dblDE / 1000) * dble_DE * Sin(dblF_DE) - (dblDE / 1000) * dblw_DE * dblw_DE * Cos(dblF_DE) If Abs(dblF_CD) > dblMax_f_CD Then dblMax_f_CD = Abs(dblF_CD) If Abs(dblW_CD) > dblMa

12、x_w_CD Then dblMax_w_CD = Abs(dblW_CD) If Abs(dblE_CD) > dblMax_f_CD Then dblMax_e_CD = Abs(dblE_CD) If Abs(dblS_E) > dblMax_s_E Then dblMax_s_E = Abs(dblS_E) If Abs(dblV_E) > dblMax_v_E Then dblMax_v_E = Abs(dblV_E) If Abs(dblA_E) > dblMax_a_E Then dblMax_a_E = Abs(dblA_E)Next iDim dblS

13、x As Double, dblSy As DoubledblSx = (dblWP - 240) / 360For 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 + d

14、blAC * 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(

15、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

16、* 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 /

17、 1000) * Cos(dblF_DE) * (dblH / 1000) - (dblCD / 1000) * Sin(dblF_CD) / (dblDE / 1000) dblA_E = (-dblCD / 1000) * dblE_CD * Sin(dblF_CD) - (dblCD / 1000) * dblW_CD * dblW_CD * Cos(dblF_CD) - (dblDE / 1000) * dble_DE * Sin(dblF_DE) - (dblDE / 1000) * dblw_DE * dblw_DE * Cos(dblF_DE) dblSy = (dblHP /

18、2 - 240) / dblMax_f_CD Picture1(0).PSet (i * dblSx, dblF_CD * dblSy) dblSy = (dblHP / 2 - 240) / dblMax_w_CD Picture1(1).PSet (i * dblSx, dblW_CD * dblSy) dblSy = (dblHP / 2 - 240) / dblMax_e_CD Picture1(2).PSet (i * dblSx, dblE_CD * dblSy * 0.25) dblSy = (dblHP / 2 - 240) / dblMax_s_E Picture1(3).P

19、Set (i * dblSx, dblS_E * dblSy) dblSy = (dblHP / 2 - 240) / dblMax_v_E Picture1(4).PSet (i * dblSx, dblV_E * dblSy) dblSy = (dblHP / 2 - 240) / dblMax_a_E Picture1(5).PSet (i * dblSx, dblA_E * dblSy)Next iEnd SubPrivate Sub Command5_Click()Dim i As DoubleDim dblAB As Double, dblCD As Double, dblDE A

20、s Double, dblAC As Double, dblH As Double, dblF_AB As Double, dbldf_CD As DoubleDim dblF_CD As Double, dblW_CD As Double, dblE_CD As DoubleDim dblS_E As Double, dblV_E As Double, dblA_E As DoubleDim dblS2 As DoubleDim dblF_DE As Double, dblw_DE As Double, dble_DE As DoubleDim PI As DoublePI = 3.1415

21、926dblAB = 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)List1.ClearList1.AddItem ("f_AB" & Chr(9) & "f_CD" & Chr(9) & "w_CD" & Chr

22、(9) & "e_CD" & Chr(9) & "s_E" & Chr(9) & "v_E" & Chr(9) & "a_E")List1.AddItem ("")For i = 0 To 360 Step 30dblF_AB = i * PI / 180dblF_CD = Atn(dblAC + dblAB * Sin(dblF_AB) / (dblAB * Cos(dblF_AB)If dblF_CD < 0 Then dblF_

23、CD = dblF_CD + PIdblW_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 - d

24、blF_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_D

25、E)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)db

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論