逐点比较法三、四象限逆圆插补计算

合集下载
相关主题
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

逐点比较法三、四象限逆圆插补计算第三象限

第四象限

Private Sub Command1_Click()

Picture1.ForeColor = vbBlack

Picture1.DrawWidth = 2

Picture1.Line (500, 1000)-(8500, 1000) '画直线坐标轴Picture1.Line (4500, 1000)-(4500, 5000)

Picture1.CurrentX = 230 '当前位置Picture1.CurrentY = 900

Picture1.Print "-X" '坐标轴标注Picture1.CurrentX = 4300

Picture1.CurrentY = 800

Picture1.Print "(0,0)"

Picture1.CurrentX = 8650

Picture1.CurrentY = 900

Picture1.Print "X"

Picture1.CurrentX = 4400

Picture1.CurrentY = 5100

Picture1.Print "-Y"

Picture1.Line (500, 1000)-(600, 950) '箭头Picture1.Line (500, 1000)-(600, 1050)

Picture1.Line (8500, 1000)-(8400, 950)

Picture1.Line (8500, 1000)-(8400, 1050)

Picture1.Line (4500, 5000)-(4450, 4900)

Picture1.Line (4500, 5000)-(4550, 4900)

End Sub

Private Sub 坐标判别_Click()

If Not (Option1.Value = True Or Option2.Value = True) Then

ans = MsgBox("出错了,请选择象限", 48, "提示信息")

End If

Dim a, b, c, d, n, m As Integer

Dim r As Single

a = Val(Text1.Text)

b = Val(Text2.Text)

c = Val(Text3.Text)

d = Val(Text4.Text)

n = a * a + b * b

m = c * c + d * d

r = Sqr(n)

If Option1.Value = True Then

If Not (a <= 0 And b <= 0 And c <= 0 And d <= 0) Then

GoTo ww

ElseIf Not (a < c And b > d) Then

GoTo ww1

ElseIf n <> m Then

GoTo ww2

End If

End If

If Option2.Value = True Then

If Not (a >= 0 And b <= 0 And c >= 0 And d <= 0) Then

GoTo ww

ElseIf Not (a < c And b < d) Then

GoTo ww1

ElseIf n <> m Then

GoTo ww2

End If

End If

GoTo ww4

ww: ans = MsgBox("出错了,逆圆弧起点、终点不在该象限,请重新输入", 48, "提示信息")

GoTo ww3

ww1: ans = MsgBox("出错了,逆圆弧起点、终点位置错误,请重新输入", 48, "提示信息") GoTo ww3

ww2: ans = MsgBox("出错了,该象限所绘圆弧不以原点为圆心,请重新输入", 48, "提示信息")

ww3: Text1.Text = ""

Text2.Text = ""

Text3.Text = ""

Text4.Text = ""

Text1.SetFocus

GoTo ww4

ww4:

End Sub

Private Sub Command4_Click()

If Not (Option1.Value = True Or Option2.Value = True) Then

ans = MsgBox("出错了,请选择象限", 48, "提示信息")

End If

Dim a, b, c, d, n, m As Integer

Dim r As Single

a = Val(Text1.Text)

b = Val(Text2.Text)

c = Val(Text3.Text)

d = Val(Text4.Text)

n = a * a + b * b

m = c * c + d * d

r = Sqr(n)

If Option1.Value = True Then

If Not (a <= 0 And b <= 0 And c <= 0 And d <= 0) Then

GoTo ww

ElseIf Not (a < c And b > d) Then

相关文档
最新文档