數(shù)字積分法直線插補第二象限全部代碼_第1頁
數(shù)字積分法直線插補第二象限全部代碼_第2頁
數(shù)字積分法直線插補第二象限全部代碼_第3頁
全文預覽已結束

下載本文檔

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

文檔簡介

1、Private Sub Command1_Click( xe = CInt(Text1 ye = CInt(Text2 If xe >= 0 And ye >= 0 Then Picture1.ForeColor = vbBlack Picture1.DrawWidth = 2 Picture1.Line (50, 5500-(50, 500 Picture1.Line (50, 5500-(5500, 5500 Picture1.Line (50, 500-(20, 600 Picture1.Line (50, 500-(80, 600 Picture1.Line (5400,

2、5470-(5500, 5500 Picture1.Line (5400, 5530-(5500, 5500 Picture1.CurrentX = 10 Picture1.CurrentY = 5300 Picture1.Print "(0,0" Picture1.CurrentX = 5500 Picture1.CurrentY = 5200 Picture1.Print "x" Picture1.CurrentX = 100 Picture1.CurrentY = 100 Picture1.Print "Y" For i = 1

3、 To xe Picture1.Line (50 + i * 500, 5500-(50 + i * 500, 5450 Next i For j = 1 To ye Picture1.Line (50, 5500 - j * 500-(100, 5500 - j * 500 Next j Picture1.ForeColor = vbRed Picture1.DrawWidth = 2 Picture1.Line (50, 5500-(50 + 500 * Int(Text1, 5500 - 500 * Int(Text2 ElseIf xe <= 0 And ye >= 0 T

4、hen Picture1.ForeColor = vbBlack Picture1.DrawWidth = 2 Picture1.Line (5500, 5500-(5500, 50 Picture1.Line (5500, 50-(5530, 150 Picture1.Line (5500, 50-(5470, 150 Picture1.Line (5500, 5500-(50, 5500 Picture1.Line (50, 5500-(150, 5470 Picture1.Line (50, 5500-(150, 5530 Picture1.CurrentX = 5600 Picture

5、1.CurrentY = 5400 Picture1.Print "(0,0" Picture1.CurrentX = 100 Picture1.CurrentY = 5200 Picture1.Print "-x" Picture1.CurrentX = 5600 Picture1.CurrentY = 100 Picture1.Print "Y" For i = 1 To -xe Picture1.Line (5500 - i * 500, 5500-(5500 - i * 500, 5450 Next i For j = 1 T

6、o ye Picture1.Line (5500, 5500 - j * 500-(5400, 5500 - j * 500 Next j Picture1.ForeColor = vbBlack Picture1.DrawWidth = 2 Picture1.Line (5500, 5500-(5500 + 500 * Int(Text1, 5500 - 500 * Int(Text2 ElseIf xe <= 0 And ye <= 0 Then Picture1.Line (5500, 50-(5500, 5500 Picture1.Line (5500, 5500-(553

7、0, 5400 Picture1.Line (5500, 5500-(5470, 5400 Picture1.Line (5500, 50-(50, 50 Picture1.Line (50, 50-(150, 20 Picture1.Line (50, 50-(150, 80 Picture1.CurrentX = 5600 Picture1.CurrentY = 40 Picture1.Print "(0,0" Picture1.CurrentX = 100 Picture1.CurrentY = 100 Picture1.Print "-x" Pi

8、cture1.CurrentX = 5600 Picture1.CurrentY = 5400 Picture1.Print "-Y" For i = 1 To -xe Picture1.Line (5500 - i * 500, 50-(5500 - i * 500, 100 Next i For j = 1 To -ye Picture1.Line (5500, 50 + j * 500-(5400, 50 + j * 500 Next j Picture1.ForeColor = vbBlack Picture1.DrawWidth = 2 Picture1.Line

9、 (5500, 50-(5500 + 500 * Int(Text1, 50 - 500 * Int(Text2 ElseIf xe >= 0 And ye <= 0 Then Picture1.ForeColor = vbBlack Picture1.DrawWidth = 2 Picture1.Line (50, 50-(5500, 50 Picture1.Line (5500, 50-(5400, 80 Picture1.Line (5500, 50-(5400, 20 Picture1.Line (50, 50-(50, 5500 Picture1.Line (50, 55

10、00-(20, 5400 Picture1.Line (50, 5500-(80, 5400 Picture1.CurrentX = 60 Picture1.CurrentY = 40 Picture1.Print "(0,0" Picture1.CurrentX = 5700 Picture1.CurrentY = 100 Picture1.Print "x" Picture1. CurrentX = 80 Picture1.CurrentY = 5400 Picture1.Print "-Y" For i = 1 To xe Pi

11、cture1.Line (50 + i * 500, 50-(50 + i * 500, 100 Next i Picture1.Print For j = 1 To -ye Picture1.Line (50, 50 + j * 500-(100, 50 + j * 500 Next j Picture1.ForeColor = vbBlack Picture1.DrawWidth = 2 Picture1.Line (50, 50-(50 + 500 * Int(Text1, 50 - 500 * Int(Text2 End If End Sub Private Sub Command2_

12、Click( n = Int(Text5 xi = 0 yi = 0 xe = CInt(Text1 ye = CInt(Text2 jvx = xe jvy = ye jrx = 0 jry = 0 If xe >= 0 And ye >= 0 Then For i = 1 To 2 n jrx = jrx + jvx If jrx >= 2 n Then jrx = jrx - 2 n k = 1 xi = xi + 1 End If jry = jry + jvy If jry >= 2 n Then jry = jry - 2 n m = 1 yi = yi +

13、 1 End If Picture1.ForeColor = vbGreen Picture1.DrawWidth = 2 If k = 1 And m = 1 Then Picture1.Line (50 + 500 * (xi - 1, 5500 - (yi - 1 * 500-(50 + 500 * (xi, 5500 - (yi * 500 ElseIf k = 1 And m = 0 Then Picture1.Line (50 + 500 * (xi - 1, 5500 - (yi * 500-(50 + 500 * (xi, 5500 - (yi * 500 ElseIf k =

14、 0 And m = 1 Then Picture1.Line (50 + 500 * xi, 5500 - (yi - 1 * 500-(50 + 500 * xi, 5500 - (yi * 500 End If Form8.CurrentX = 200 Form8.CurrentY = 200 + 300 * i Print "第" & i & " 步" & " jvx= " & jvx & " jrx= " & jrx & " jvy= &q

15、uot; & jvy & " jry= " & jry k = 0 m = 0 Next i ElseIf xe <= 0 And ye >= 0 Then For i = 1 To 2 n jrx = jrx + Abs(jvx If Abs(jrx >= 2 n Then jrx = Abs(jrx - 2 n k = 1 xi = xi + 1 End If jry = jry + jvy If jry >= 2 n Then jry = jry - 2 n m = 1 yi = yi + 1 End If If k =

16、 1 And m = 1 Then Picture1.Line (5500 - 500 * (xi - 1, 5500 - (yi - 1 * 500-(5500 - 500 * xi, 5500 - yi * 500 ElseIf k = 1 And m = 0 Then Picture1.Line (5500 - 500 * (xi - 1, 5500 - (yi * 500-(5500 - 500 * (xi, 5500 - (yi * 500 ElseIf k = 0 And m = 1 Then Picture1.Line (5500 - 500 * xi, 5500 - (yi -

17、 1 * 500-(5500 - 500 * xi, 5500 - (yi * 500 End If Form1.FontSize = 12 Print "第" & i & " 步" & " jvx= " & jvx & " jrx= " & jrx & " jvy= " & jvy & " jry= " & jry k = 0 m = 0 Next i ElseIf xe <= 0 And

18、 ye <= 0 Then For i = 1 To 2 n jrx = jrx + Abs(jvx If Abs(jrx >= 2 n Then jrx = Abs(jrx - 2 n k = 1 xi = xi + 1 End If jry = jry + Abs(jvy If Abs(jry >= 2 n Then jry = Abs(jry - 2 n m = 1 yi = yi + 1 End If If k = 1 And m = 1 Then Picture1.Line (5500 - 500 * (xi - 1, 50 + (yi - 1 * 500-(550

19、0 - 500 * (xi, 50 + (yi * 500 ElseIf k = 1 And m = 0 Then Picture1.Line (5500 - 500 * (xi - 1, 50 + (yi * 500-(5500 - 500 * (xi, 50 + (yi * 500 ElseIf k = 0 And m = 1 Then Picture1.Line (5500 - 500 * xi, 50 + (yi - 1 * 500-(5500 - 500 * xi, 50 + (yi * 500 End If Form1.FontSize = 12 Print "第&quo

20、t; & i & " 步" & " jvx= " & jvx & " jrx= " & jrx & " jvy= " & jvy & " jry= " & jry k = 0 m = 0 Next i Els eIf xe >= 0 And ye <= 0 Then For i = 1 To 2 n jrx = jrx + jvx If jrx >= 2 n Then jrx = jrx - 2 n k = 1 xi = xi + 1 End If jry = jry + Abs(jvy If Abs(jry >= 2 n Then jry = Abs(jry - 2 n m = 1 yi = yi + 1 End If If k = 1 And

溫馨提示

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

評論

0/150

提交評論