ImageVerifierCode 换一换
格式:DOCX , 页数:23 ,大小:152.74KB ,
资源ID:8855891      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/8855891.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(完整版基于vb的直线插补与圆弧插补实验.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

完整版基于vb的直线插补与圆弧插补实验.docx

1、完整版基于vb的直线插补与圆弧插补实验主界面面板逐点比较圆弧插补程序如下:Private Sub Command1_Click()Xe = Val(Text1.Text)Ye = Val(Text2.Text)Picture1.Scale (-20, 20)-(20, -20)Picture1.ClsPicture1.Line (-20, 0)-(20, 0), vbBluePicture1.Line (19, 1)-(20, 0), vbbiuePicture1.Line -(19, -1), vbBluePicture1.Print XPicture1.Line (0, -20)-(0,

2、20), vbBluePicture1.Line (1, 19)-(0, 20), vbBluePicture1.Line -(-1, 19), vbBluePicture1.Print YPicture1.Line (0, 0)-(Xe, Ye), vbBluePicture1.Print (; Xe; ,; Ye; )If Text1.Text = none Or Text2.Text = none Then MsgBox 请输入加工终点坐标值。Text3.Text = 0Text4.Text = 0Text5.Text = 0End SubPrivate Sub Command2_Cli

3、ck()Dim sum As IntegerXe = Val(Text1.Text)Ye = Val(Text2.Text)Xm = Val(Text3.Text)Ym = Val(Text4.Text)m = Val(Text5.Text)sum = Xe * Ym - Xm * Ye第一象限开始If Xe 0 And Ye 0 And sum = 0 Then Picture1.Line (Xm, Ym)-(Xm + 1, Ym), vbRed: Text3.Text = Xm + 1If Xe 0 And Ye 0 And sum = Abs(Xe) + Abs(Ye) - 1 Then

4、 MsgBox 加工完毕!第二象限开始If Xe 0 And sum = 0 Then Picture1.Line (Xm, Ym)-(Xm, Ym + 1), vbRed: Text4.Text = Ym + 1If Xe 0 And sum = Abs(Xe) + Abs(Ye) + 1 Then MsgBox 加工完毕!第三象限开始If Xe 0 And Ye = 0 Then Picture1.Line (Xm, Ym)-(Xm - 1, Ym), vbRed: Text3.Text = Xm - 1If Xe 0 And Ye 0 And sum = Abs(Xe) + Abs(Ye

5、) Then MsgBox 加工完毕!第四象限开始If Xe 0 And Ye = 0 Then Picture1.Line (Xm, Ym)-(Xm, Ym - 1), vbRed: Text4.Text = Ym - 1If Xe 0 And Ye 0 And sum = Abs(Xe) + Abs(Ye) Then MsgBox 加工完毕!Text5.Text = Abs(Val(Text3.Text) + Abs(Val(Text4.Text)End SubPrivate Sub Command3_Click()Form2.HideForm1.ShowEnd Sub数字积分器法圆弧插补

6、程序如下:Private Sub Command1_Click()Xe = Val(Text1.Text)Ye = Val(Text2.Text)Picture1.Scale (-20, 20)-(20, -20)Picture1.ClsPicture1.Line (-20, 0)-(20, 0), vbBluePicture1.Line (19, 1)-(20, 0), vbbiuePicture1.Line -(19, -1), vbBluePicture1.Print XPicture1.Line (0, -20)-(0, 20), vbBluePicture1.Line (1, 19)

7、-(0, 20), vbBluePicture1.Line -(-1, 19), vbBluePicture1.Print YPicture1.Line (0, 0)-(Xe, Ye), vbBluePicture1.Print (; Xe; ,; Ye; )Text3.Text = 0Text4.Text = 0Text5.Text = 0Text6.Text = 0Text7.Text = 0End SubPrivate Sub Command2_Click()Xe = Val(Text1.Text)Ye = Val(Text2.Text)ax = Val(Text3.Text)ay =

8、Val(Text4.Text)n = Val(Text7.Text)Xm = Val(Text5.Text)Ym = Val(Text6.Text)If Text1.Text = none Or Text2.Text = none Then MsgBox 请输入加工终点坐标值。终点判断a = ax + Abs(Xe)If a = 16 Then Text3.Text = a - 16If a = 32 Then Text3.Text = a - 32b = ay + Abs(Ye)If b = 16 Then Text4.Text = b - 16If b = 32 Then Text4.Te

9、xt = b - 32第一象限开始If Xe 0 And Ye 0 And a = 16 And b 0 And Ye 0 And a = 16 And b = 16 Then Picture1.Line (Xm, Ym)-(Xm + 1, Ym + 1), vbRed: Text7.Text = n + 2: Text5.Text = Xm + 1: Text6.Text = Ym + 1If Xe 0 And Ye 0 And a = 16 Then Picture1.Line (Xm, Ym)-(Xm, Ym + 1), vbRed: Text7.Text = n + 1: Text6.

10、Text = Ym + 1If n = Abs(Xe) + Abs(Ye) Then MsgBox 错误:已经加工完毕,无法继续加工,请点击复位!第二象限开始If Xe 0 And a = 16 And b 16 Then Picture1.Line (Xm, Ym)-(Xm - 1, Ym), vbRed: Text7.Text = n + 1: Text5.Text = Xm - 1If Xe 0 And a = 16 And b = 16 Then Picture1.Line (Xm, Ym)-(Xm - 1, Ym + 1), vbRed: Text7.Text = n + 2: Te

11、xt5.Text = Xm - 1: Text6.Text = Ym + 1If Xe 0 And a = 16 Then Picture1.Line (Xm, Ym)-(Xm, Ym + 1), vbRed: Text7.Text = n + 1: Text6.Text = Ym + 1第三象限开始If Xe 0 And Ye = 16 And b 16 Then Picture1.Line (Xm, Ym)-(Xm - 1, Ym), vbRed: Text7.Text = n + 1: Text5.Text = Xm - 1If Xe 0 And Ye = 16 And b = 16 T

12、hen Picture1.Line (Xm, Ym)-(Xm - 1, Ym - 1), vbRed: Text7.Text = n + 2: Text5.Text = Xm - 1: Text6.Text = Ym - 1If Xe 0 And Ye 0 And a = 16 Then Picture1.Line (Xm, Ym)-(Xm, Ym - 1), vbRed: Text7.Text = n + 1: Text6.Text = Ym - 1第四象限开始If Xe 0 And Ye = 16 And b 0 And Ye = 16 And b = 16 Then Picture1.L

13、ine (Xm, Ym)-(Xm + 1, Ym - 1), vbRed: Text7.Text = n + 2: Text5.Text = Xm + 1: Text6.Text = Ym - 1If Xe 0 And Ye 0 And a = 16 Then Picture1.Line (Xm, Ym)-(Xm, Ym - 1), vbRed: Text7.Text = n + 1: Text6.Text = Ym - 1结束If n = Abs(Xe) + Abs(Ye) Then Text7.Text = Abs(Xe) + Abs(Ye)If n = Abs(Xe) + Abs(Ye)

14、 - 1 And a = 16 Then MsgBox 加工完毕!If n = Abs(Xe) + Abs(Ye) - 1 And b = 16 Then MsgBox 加工完毕!If n = Abs(Xe) + Abs(Ye) - 2 And a = 16 And b = 16 Then MsgBox 加工完毕!End SubPrivate Sub Command3_Click()Form3.HideForm1.ShowEnd Sub逐点比较圆弧插补程序如下:Dim R, a, b, Ym, Xm, Xe, YePrivate Sub Command1_Click()R = Val(Text

15、1.Text)a = Val(Text2.Text)b = Val(Text3.Text)Xe = Val(Text4.Text)Ye = Val(Text5.Text)Xm = Val(Text6.Text)Ym = Val(Text7.Text)Picture1.Scale (-Picture1.ScaleWidth / 4, Picture1.ScaleHeight / 4)-(Picture1.ScaleWidth / 4, -Picture1.ScaleHeight / 4)Picture1.ClsPicture1.Line (-20, 0)-(20, 0), vbBluePictu

16、re1.Line (19, 1)-(20, 0), vbbiuePicture1.Line -(19, -1), vbBluePicture1.Print XPicture1.Line (0, -20)-(0, 20), vbBluePicture1.Line (1, 19)-(0, 20), vbBluePicture1.Line -(-1, 19), vbBluePicture1.Print YPicture1.Circle (0, 0), Text1, vbBlue, Text2, Text3Picture1.Print (; Xe; ,; Ye; )Text1.Text = Text2

17、.Text = Text3.Text = Text6.Text = Text7.Text = End SubPrivate Sub Command2_Click()Dim sum As Single, Y, XIf Option1 Then 逆圆弧 Y = Sqr(R 2 - Xm 2) X = Sqr(R 2 - Ym 2) If Xm = R And Ym = 0 Then 一象限 Picture1.Line (Xm, Ym)-(Xm, Ym + 1), vbRed: Ym = Ym + 1 Text7.Text = Ym + 1 End If If Xm 0 And Ym 0 Then

18、If Xm = X Then Picture1.Line (Xm, Ym)-(Xm - 1, Ym), vbRed: Text6.Text = Xm - 1: Xm = Xm - 1 Else If Ym Y Then Picture1.Line (Xm, Ym)-(Xm, Ym + 1), vbRed: Text7.Text = Ym + 1: Ym = Ym + 1 End If End If End IfIf Xm = Xe And Ym = Ye Then MsgBox 加工完成!End IfIf Xm = 0 And Ym = R Then 二象限 Picture1.Line (Xm

19、, Ym)-(Xm - 1, Ym), vbRed: Xm = Xm - 1 Text6.Text = Xm - 1End IfIf Xm 0 Then If Ym = Y Then Picture1.Line (Xm, Ym)-(Xm, Ym - 1), vbRed: Ym = Ym - 1: Text7.Text = Ym - 1 Else If Xm -X Then Picture1.Line (Xm, Ym)-(Xm - 1, Ym), vbRed: Xm = Xm - 1: Text6.Text = Xm - 1 End If End IfEnd IfIf Xm = Xe And Y

20、m = Ye Then MsgBox 加工完成!End If If Xm = -R And Ym = 0 Then 三象限 Picture1.Line (Xm, Ym)-(Xm, Ym - 1), vbRed: Ym = Ym - 1 Text7.Text = Ym - 1End IfIf Xm 0 And Ym 0 Then If Ym -X Then Picture1.Line (Xm, Ym)-(Xm, Ym - 1), vbRed: Ym = Ym - 1: Text7.Text = Ym - 1 End If End IfEnd IfIf Xm = Xe And Ym = Ye Th

21、en MsgBox 加工完成!End IfIf Xm = 0 And Ym = -R Then 四象限 Picture1.Line (Xm + 1, Ym)-(Xm, Ym), vbRed: Xm = Xm + 1: Text6.Text = Xm + 1End IfIf Xm 0 And Ym 0 Then If Ym -Y Then Picture1.Line (Xm, Ym)-(Xm, Ym + 1), vbRed: Ym = Ym + 1: Text7.Text = Ym + 1 Else If Xm 0 And Ym 0 Then If Ym Y Then Picture1.Line

22、 (Xm, Ym)-(Xm, Ym - 1), vbRed: Ym = Ym - 1: Text7.Text = Ym - 1 Else If Xm X Then Picture1.Line (Xm, Ym)-(Xm + 1, Ym), vbRed: Xm = Xm + 1: Text6.Text = Xm + 1 End If End IfEnd IfIf Xm = Xe And Ym = Ye Then MsgBox 加工完成!End IfIf Xm = -R And Ym = 0 Then 第二象限 Picture1.Line (Xm, Ym)-(Xm, Ym + 1), vbRed:

23、Ym = Ym + 1: Text7.Text = Ym + 1End IfIf Xm 0 Then If Ym Y Then Picture1.Line (Xm, Ym)-(Xm, Ym + 1), vbRed: Ym = Ym + 1: Text7.Text = Ym + 1 Else If Xm -X Then Picture1.Line (Xm, Ym)-(Xm + 1, Ym), vbRed: Xm = Xm + 1: Text6.Text = Xm + 1 End If End IfEnd IfIf Xm = Xe And Ym = Ye Then MsgBox 加工完成!End

24、IfIf Xm = 0 And Ym = -R Then 第三象限 Picture1.Line (Xm, Ym)-(Xm - 1, Ym), vbRed: Xm = Xm - 1: Text6.Text = Xm - 1End IfIf Xm 0 And Ym 0 Then If Ym -X Then Picture1.Line (Xm, Ym)-(Xm - 1, Ym), vbRed: Xm = Xm - 1: Text6.Text = Xm - 1 End If End IfEnd IfIf Xm = Xe And Ym = Ye Then MsgBox 加工完成!End IfIf Xm

25、= R And Ym = 0 Then 第四象限 Picture1.Line (Xm, Ym)-(Xm, Ym - 1), vbRed: Ym = Ym - 1: Text7.Text = Ym - 1End IfIf Xm 0 And Ym X Then Picture1.Line (Xm, Ym)-(Xm - 1, Ym), vbRed: Xm = Xm - 1: Text6.Text = Xm - 1 Else If Ym -Y Then Picture1.Line (Xm, Ym)-(Xm, Ym - 1), vbRed: Ym = Ym - 1: Text7.Text = Ym - 1 End If End IfEnd IfIf Xm = Xe And Ym = Ye Then MsgBox 加工完成!End IfEnd IfEnd SubPrivate Sub Command3_Click()Form4.HideForm1.ShowEnd Sub数字积分器法圆弧插补程序如下:Dim R, a, b, Ym, Xm, Xe, Ye, ax, ay, m, n, s, tPrivate Sub Command1_Click()R = Val(Text1.Text)a = Val(Text2.Text)b = Val(Text3.Te

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1