admin管理员组文章数量:1567918
2023年12月12日发(作者:)
五、算法程序
Private Sub Command1_Click()
lor = vbBlack
dth = 2
(0, 4000)-(9000, 4000)
(4500, 0)-(4500, 8000)
End Sub
Private Sub Command2_Click()
lor = vbBlue
dth = 2
If Val() * Val() + Val() * Val() <> Val() * Val() + Val()
* Val() Then
ans = MsgBox("出错了,该象限所绘圆弧不以原点为圆心", 48, "提示信息")
= ""
= ""
= ""
= ""
= ""
= ""
Else
If = True Then
If Val(Text1) >= 0 And Val(Text2) >= 0 And Val(Text3) >= 0 And Val(Text4) >= 0 And Val(Text1) >= Val(Text3) Then
If Int(Text2) = 0 Then
If Int(Text3) = 0 Then
(4500, 4000), Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2)) * Int(Text6), , 0, 3.14159
/ 2
= Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2))
Else
(4500, 4000), Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2)) * Int(Text6), ,
Atn(Val(Text2) / Val(Text1)), 3.14159 / 2
= Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2))
End If
ElseIf Int(Text4) = 0 Then
(4500, 4000), Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2)) * Int(Text6), , 0,
Atn(Val(Text2) / Val(Text1))
Else
(4500, 4000), Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2)) * Int(Text6), ,
Atn(Val(Text2) / Val(Text1)), Atn(Val(Text4) / Val(Text3))
= Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2))
End If
Else
ans = MsgBox("坐标象限错误或预定圆弧将为顺时针", 48, "提示信息")
= ""
= ""
= ""
= ""
= ""
= ""
End If
ElseIf = True Then
If Val(Text1) >= 0 And Val(Text2) <= 0 And Val(Text3) >= 0 And Val(Text4) <= 0 And Val(Text1) <= Val(Text3) Then
If Int(Text2) = 0 Then
If Val(Text3) = 0 Then
(4500, 4000), Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2)) * Int(Text6), , 3 * 3.14159
/ 2, 0
= Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2))
Else
(4500, 4000), Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2)) * Int(Text6), ,
Atn(Val(Text4) / Val(Text3)) + 3.14159 * 2, 0 = Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2))
End If
ElseIf Val(Text3) <> 0 Then
(4500, 4000), Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2)) * Int(Text6), ,
Atn(Val(Text2) / Val(Text1)) + 3.14159 * 2, Atn(Val(Text4) / Val(Text3)) + 3.14159 * 2
= Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2))
Else
(4500, 4000), Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2)) * Int(Text6), , 3 * 3.14159
/ 2, Atn(Val(Text2) / Val(Text1)) + 3.14159 * 2
= Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2))
End If
Else
ans = MsgBox("坐标象限错误或预定圆弧将为顺时针", 48, "提示信息")
= ""
= ""
= ""
= ""
= ""
= ""
End If
ElseIf = True Then
If Val(Text1) <= 0 And Val(Text2) >= 0 And Val(Text3) <= 0 And Val(Text4) >= 0 And Val(Text1) >= Val(Text3) Then
If Int(Text2) = 0 Then
If Val(Text3) = 0 Then
(4500, 4000), Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2)) * Int(Text6), , 3.14159
/ 2, 3.14159
= Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2))
Else
(4500, 4000), Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2)) * Int(Text6), ,
Atn(Val(Text4) / Val(Text3)) + 3.14159, 3.14159
= Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2))
End If
ElseIf Val(Text3) = 0 Then
(4500, 4000), Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2)) * Int(Text6), , 3.14159 /
2, Atn(Val(Text4) / Val(Text3)) + 3.14159
= Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2))
Else
(4500, 4000), Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2)) * Int(Text6), , Atn(Val(Text2)
/ Val(Text1)) + 3.14159, Atn(Val(Text4) / Val(Text3)) + 3.14159
= Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2))
End If
Else
ans = MsgBox("坐标象限错误或预定圆弧将为顺时针", 48, "提示信息")
= ""
= ""
= ""
= ""
= ""
= ""
End If
ElseIf = True Then
If Val(Text1) <= 0 And Val(Text2) <= 0 And Val(Text3) <= 0 And Val(Text4) <= 0 And Val(Text1) <= Val(Text3) Then
If Int(Text1) = 0 Then
If Int(Text4) = 0 Then
(4500, 4000), Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2)) * Int(Text6), ,
3.14159, 3 * 3.14159 / 2
= Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2))
Else (4500, 4000), Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2)) * Int(Text6), ,
Atn(Int(Text4) / Int(Text3)) + 3.14159, 3 * 3.14159 / 2
= Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2))
End If
ElseIf Int(Text4) = 0 Then
(4500, 4000), Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2)) * Int(Text6), , 3.14159,
Atn(Int(Text2) / Int(Text1)) + 3.14159
= Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2))
Else
(4500, 4000), Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2)) * Int(Text6), , Atn(Int(Text2)
/ Int(Text1)) + 3.14159, Atn(Int(Text4) / Int(Text3)) + 3.14159
= Sqr(Val(Text1) * Val(Text1) + Val(Text2) * Val(Text2))
End If
Else
ans = MsgBox("坐标象限错误或预定圆弧将为顺时针", 48, "提示信息")
= ""
= ""
= ""
= ""
= ""
= ""
End If
End If
End If
End Sub
Private Sub Command3_Click()
If Val() * Val() + Val() * Val() <> Val() * Val() + Val()
* Val() Then
ans = MsgBox("出错了", 48, "提示信息")
= ""
= ""
= ""
= ""
= ""
= ""
Else
Dim k, m, j, l, n, F(20) As Integer
Dim a, b, c, d, e As Integer
m = 0
l = 0
k = 0
F(m) = 0
a = Int(Text1)
b = Int(Text2)
c = Int(Text3)
d = Int(Text4)
e = Int(Text6)
lor = vbGreen
dth = 3
j = Abs(c - a) + Abs(d - b)
tX = 15000
tY = 200
If = True Then
If Val(Text1) >= 0 And Val(Text2) >= 0 And Val(Text3) >= 0 And Val(Text4) >= 0 And = True Then
Print "初始:进给方向 " & "F(m)=0" & " X0=" & Int(Text1) & " Y0=" & Int(Text2) & " ∑ = " & j
For n = 1 To j
If F(m) >= 0 Then
m = m + 1
k = k + 1
F(m) = F(m - 1) - 2 * a + 1 (4500 + Int(Text1) * e - e * (k - 1), 4000 - Int(Text2) * e - l * e)-(4500 + Int(Text1) * e - e * k, 4000
- Int(Text2) * e - l * e)
a = a - 1
tX = 15000
tY = 200 + n * 300
Print "第" & m & "步" & " -△x F(" & m & ")= " & F(m) & " " & "x=" & a & " " & "y="; b & " ∑=" & j
- n
Else
l = l + 1
m = m + 1
(4500 + Int(Text1) * e - e * k, 4000 - Int(Text2) * e - (l - 1) * e)-(4500 + Int(Text1) * e - e * k, 4000
- Int(Text2) * e - l * e)
F(m) = F(m - 1) + 2 * b + 1
b = b + 1
tX = 15000
tY = 200 + n * 300
Print "第" & m & "步" & " +△y F(" & m & ")= " & F(m) & " " & "x=" & a & " " & "y="; b & " ∑=" & j
- n
End If
Next n
Else
ans = MsgBox("出错", 48, "提示信息")
= ""
= ""
= ""
= ""
= ""
= ""
End If
ElseIf = True Then
If Val(Text1) >= 0 And Val(Text2) <= 0 And Val(Text3) >= 0 And Val(Text4) <= 0 And = True Then
Print "初始:进给方向 " & "F(m)=0" & " X0=" & Int(Text1) & " Y0=" & Int(Text2) & " ∑ = " & j
For n = 1 To j
If F(m) >= 0 Then
m = m + 1
l = l + 1
F(m) = F(m - 1) - 2 * Abs(b) + 1
(4500 + Int(Text1) * e + e * k, 4000 - Int(Text2) * e - (l - 1) * e)-(4500 + Int(Text1) * e + e * k, 4000
- Int(Text2) * e - l * e)
b = b + 1
tX = 15000
tY = 200 + n * 300
Print "第" & m & "步" & " +△y F(" & m & ")= " & F(m) & " " & "x=" & a & " " & "y="; b & " ∑=" & j
- n
Else
k = k + 1
m = m + 1
(4500 + Int(Text1) * e + e * (k - 1), 4000 - Int(Text2) * e - l * e)-(4500 + Int(Text1) * e + e * k, 4000
- Int(Text2) * e - l * e)
F(m) = F(m - 1) + 2 * Abs(a) + 1
a = a + 1
tX = 15000
tY = 200 + n * 300
Print "第" & m & "步" & " +△x F(" & m & ")= " & F(m) & " " & "x=" & a & " " & "y="; b & " ∑=" & j
- n
End If
Next n
Else
ans = MsgBox("出错", 48, "提示信息")
= ""
= ""
= "" = ""
= ""
= ""
End If
ElseIf = True Then
If Val(Text1) <= 0 And Val(Text2) >= 0 And Val(Text3) <= 0 And Val(Text4) >= 0 And = True Then
Print "初始:进给方向 " & "F(m)=0" & " X0=" & Int(Text1) & " Y0=" & Int(Text2) & " ∑ = " & j
For n = 1 To j
If F(m) >= 0 Then
m = m + 1
l = l + 1
F(m) = F(m - 1) - 2 * Abs(b) + 1
(4500 + Int(Text1) * e - e * k, 4000 - Int(Text2) * e + (l - 1) * e)-(4500 + Int(Text1) * e - e * k, 4000
- Int(Text2) * e + l * e)
b = b - 1
tX = 15000
tY = 200 + n * 300
Print "第" & m & "步" & " -△y F(" & m & ")= " & F(m) & " " & "x=" & a & " " & "y="; b & " ∑=" & j
- n
Else
k = k + 1
m = m + 1
(4500 + Int(Text1) * e - e * (k - 1), 4000 - Int(Text2) * e + l * e)-(4500 + Int(Text1) * e - e * k, 4000
- Int(Text2) * e + l * e)
F(m) = F(m - 1) + 2 * Abs(a) + 1
a = a - 1
tX = 15000
tY = 200 + n * 300
Print "第" & m & "步" & " -△x F(" & m & ")= " & F(m) & " " & "x=" & a & " " & "y="; b & " ∑=" & j
- n
End If
Next n
Else
ans = MsgBox("出错", 48, "提示信息")
= ""
= ""
= ""
= ""
= ""
= ""
End If
ElseIf = True Then
If Val(Text1) <= 0 And Val(Text2) <= 0 And Val(Text3) <= 0 And Val(Text4) <= 0 And = True Then
Print "初始:进给方向 " & "F(m)=0" & " X0=" & Int(Text1) & " Y0=" & Int(Text2) & " ∑ = " & j
For n = 1 To j
If F(m) >= 0 Then
m = m + 1
k = k + 1
F(m) = F(m - 1) - 2 * Abs(a) + 1
(4500 + Int(Text1) * e + e * (k - 1), 4000 - Int(Text2) * e + l * e)-(4500 + Int(Text1) * e + e * k, 4000
- Int(Text2) * e + l * e)
a = a + 1
tX = 15000
tY = 200 + n * 300
Print "第" & m & "步" & " +△x F(" & m & ")= " & F(m) & " " & "x=" & a & " " & "y="; b & " ∑=" & j - n
Else
l = l + 1
m = m + 1
F(m) = F(m - 1) + 2 * Abs(b) + 1 (4500 + Int(Text1) * e + e * k, 4000 - Int(Text2) * e + (l - 1) * e)-(4500 + Int(Text1) * e + e * k, 4000
- Int(Text2) * e + l * e)
b = b - 1
tX = 15000
tY = 200 + n * 300
Print "第" & m & "步" & " -△y F(" & m & ")= " & F(m) & " " & "x=" & a & " " & "y="; b & " ∑=" & j
- n
End If
Next n
Else
ans = MsgBox("出错", 48, "提示信息")
= ""
= ""
= ""
= ""
= ""
= ""
End If
End If
End If
End Sub
Private Sub Command4_Click()
= ""
= ""
= ""
= ""
= ""
= ""
lor = vbBlack
dth = 2
(0, 4000)-(9000, 4000)
(4500, 0)-(4500, 8000)
End Sub
Private Sub Command5_Click()
= ""
= ""
= ""
= ""
= ""
= ""
End Sub
Private Sub Command6_Click()
End
End Sub
Private Sub Command7_Click()
End Sub
版权声明:本文标题:VB软件 模拟逐点比较法逆圆弧插补的程序设计 程序 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/dianzi/1702384922a4287.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论