数字积分法直线插补第二象限全部代码_第1页
数字积分法直线插补第二象限全部代码_第2页
数字积分法直线插补第二象限全部代码_第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. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论