📄 form2.frm
字号:
VERSION 5.00
Object = "{74848F95-A02A-4286-AF0C-A3C755E4A5B3}#1.0#0"; "actskn43.ocx"
Begin VB.Form Form2
Caption = "极坐标放样数据计算"
ClientHeight = 5865
ClientLeft = 2775
ClientTop = 2340
ClientWidth = 8190
LinkTopic = "Form2"
MaxButton = 0 'False
ScaleHeight = 5865
ScaleWidth = 8190
Begin ACTIVESKINLibCtl.SkinLabel SkinLabel1
Height = 735
Left = 1800
OleObjectBlob = "Form2.frx":0000
TabIndex = 26
Top = 240
Width = 4455
End
Begin ACTIVESKINLibCtl.Skin Skin1
Left = 480
OleObjectBlob = "Form2.frx":006E
Top = 240
End
Begin VB.CommandButton Command1
Caption = "计算"
Height = 495
Left = 1680
TabIndex = 25
Top = 5280
Width = 1935
End
Begin VB.CommandButton Command2
Caption = "继续"
Height = 495
Left = 4800
TabIndex = 24
Top = 5280
Width = 1815
End
Begin VB.Frame Frame2
Caption = "输出结果"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1575
Left = 360
TabIndex = 2
Top = 3480
Width = 7335
Begin ACTIVESKINLibCtl.SkinLabel SkinLabel13
Height = 375
Left = 480
OleObjectBlob = "Form2.frx":02A2
TabIndex = 38
Top = 960
Width = 5655
End
Begin ACTIVESKINLibCtl.SkinLabel SkinLabel12
Height = 255
Left = 3600
OleObjectBlob = "Form2.frx":0326
TabIndex = 37
Top = 480
Width = 1095
End
Begin ACTIVESKINLibCtl.SkinLabel SkinLabel11
Height = 255
Left = 720
OleObjectBlob = "Form2.frx":0390
TabIndex = 36
Top = 480
Width = 735
End
Begin VB.TextBox Text8
Height = 375
Left = 4920
TabIndex = 23
Top = 360
Width = 1455
End
Begin VB.TextBox Text7
Height = 375
Left = 1560
TabIndex = 22
Top = 360
Width = 1455
End
Begin VB.Label Label6
Caption = "角度为负号表示拨角时,转向为向左,正号则为向右"
Height = 495
Left = 480
TabIndex = 15
Top = 960
Width = 5895
End
Begin VB.Label Label5
Caption = "距离(m):"
Height = 375
Index = 2
Left = 3600
TabIndex = 14
Top = 480
Width = 1215
End
Begin VB.Label Label5
Caption = "角度:"
Height = 375
Index = 0
Left = 720
TabIndex = 12
Top = 480
Width = 975
End
End
Begin VB.Frame Frame1
Caption = "输入数据"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 2175
Left = 360
TabIndex = 1
Top = 1080
Width = 7335
Begin ACTIVESKINLibCtl.SkinLabel SkinLabel10
Height = 255
Left = 4320
OleObjectBlob = "Form2.frx":03F4
TabIndex = 35
Top = 1680
Width = 375
End
Begin ACTIVESKINLibCtl.SkinLabel SkinLabel9
Height = 255
Left = 1920
OleObjectBlob = "Form2.frx":045A
TabIndex = 34
Top = 1680
Width = 375
End
Begin ACTIVESKINLibCtl.SkinLabel SkinLabel8
Height = 255
Left = 600
OleObjectBlob = "Form2.frx":04C0
TabIndex = 33
Top = 1680
Width = 1095
End
Begin ACTIVESKINLibCtl.SkinLabel SkinLabel7
Height = 255
Left = 4320
OleObjectBlob = "Form2.frx":052A
TabIndex = 32
Top = 1080
Width = 495
End
Begin ACTIVESKINLibCtl.SkinLabel SkinLabel6
Height = 255
Left = 1920
OleObjectBlob = "Form2.frx":0590
TabIndex = 31
Top = 1080
Width = 375
End
Begin ACTIVESKINLibCtl.SkinLabel SkinLabel5
Height = 255
Left = 600
OleObjectBlob = "Form2.frx":05F6
TabIndex = 30
Top = 1080
Width = 1215
End
Begin ACTIVESKINLibCtl.SkinLabel SkinLabel4
Height = 255
Left = 4320
OleObjectBlob = "Form2.frx":0660
TabIndex = 29
Top = 480
Width = 495
End
Begin ACTIVESKINLibCtl.SkinLabel SkinLabel3
Height = 255
Left = 1920
OleObjectBlob = "Form2.frx":06C6
TabIndex = 28
Top = 480
Width = 375
End
Begin ACTIVESKINLibCtl.SkinLabel SkinLabel2
Height = 375
Left = 600
OleObjectBlob = "Form2.frx":072C
TabIndex = 27
Top = 480
Width = 1095
End
Begin VB.TextBox Text6
Height = 375
Left = 4920
TabIndex = 21
Top = 1560
Width = 1455
End
Begin VB.TextBox Text5
Height = 375
Left = 2400
TabIndex = 20
Top = 1560
Width = 1455
End
Begin VB.TextBox Text4
Height = 375
Left = 4920
TabIndex = 19
Top = 960
Width = 1455
End
Begin VB.TextBox Text3
Height = 375
Left = 2400
TabIndex = 18
Top = 960
Width = 1455
End
Begin VB.TextBox Text2
Height = 375
Left = 4920
TabIndex = 17
Top = 360
Width = 1455
End
Begin VB.TextBox Text1
Height = 375
Left = 2400
TabIndex = 16
Top = 360
Width = 1455
End
Begin VB.Label Label4
Caption = "y(m)"
Height = 255
Index = 5
Left = 4320
TabIndex = 11
Top = 480
Width = 735
End
Begin VB.Label Label4
Caption = "y(m)"
Height = 255
Index = 4
Left = 4320
TabIndex = 10
Top = 1080
Width = 735
End
Begin VB.Label Label4
Caption = "y(m)"
Height = 255
Index = 3
Left = 4320
TabIndex = 9
Top = 1680
Width = 735
End
Begin VB.Label Label4
Caption = "x(m)"
Height = 255
Index = 2
Left = 1920
TabIndex = 8
Top = 1080
Width = 735
End
Begin VB.Label Label4
Caption = "x(m)"
Height = 255
Index = 1
Left = 1920
TabIndex = 7
Top = 1680
Width = 735
End
Begin VB.Label Label4
Caption = "x(m)"
Height = 255
Index = 0
Left = 1920
TabIndex = 6
Top = 480
Width = 735
End
Begin VB.Label Label3
Caption = "后视点坐标:"
Height = 375
Index = 2
Left = 600
TabIndex = 5
Top = 1080
Width = 1095
End
Begin VB.Label Label3
Caption = "放样点坐标:"
Height = 375
Index = 1
Left = 600
TabIndex = 4
Top = 1680
Width = 1095
End
Begin VB.Label Label3
Caption = "设站点坐标:"
Height = 375
Index = 0
Left = 600
TabIndex = 3
Top = 480
Width = 1095
End
End
Begin VB.Label Label5
Caption = "Label5"
Height = 375
Index = 1
Left = 4320
TabIndex = 13
Top = 4080
Width = 975
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "极坐标放样数据计算"
Height = 615
Left = 1800
TabIndex = 0
Top = 240
Width = 4335
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim x1!, y1!, x2!, y2!, x3!, y3!, j!, jAB!, jAC!, s!, d%, f%, m!, z1!, z2!
x1 = Val(Text1.Text)
y1 = Val(Text2.Text)
x2 = Val(Text3.Text)
y2 = Val(Text4.Text)
x3 = Val(Text5.Text)
y3 = Val(Text6.Text)
If x1 < x2 Then
If y1 <= y2 Then
jAB = Atn((y1 - y2) / (x1 - x2))
Else
jAB = 3.14159 * 2 + Atn((y1 - y2) / (x1 - x2))
End If
ElseIf x1 = x2 Then
If y1 < y2 Then
jAB = 3.14159 / 2
ElseIf y1 = y2 Then
MsgBox "注意:设站点与后视点重合", 48, "错误提示"
Else
jAB = 3.14159 * 1.5
End If
Else
If y1 < y2 Then
jAB = 3.14159 + Atn((y1 - y2) / (x1 - x2))
ElseIf y1 = y2 Then
jAB = 3.14159
Else
jAB = 3.14159 + Atn((y1 - y2) / (x1 - x2))
End If
End If '以上是讨论角AB在各象限的情况然后各象限的角AB值
If x1 < x3 Then
If y1 <= y3 Then
jAC = Atn((y1 - y3) / (x1 - x3))
Else
jAC = 3.14159 * 2 + Atn((y1 - y3) / (x1 - x3))
End If
ElseIf x1 = x3 Then
If y1 < y3 Then
jAC = 3.14159 / 2
ElseIf y1 = y3 Then
MsgBox "注意:设站点与放样点重合", 48, "错误提示"
Else
jAC = 3.14159 * 1.5
End If
Else
If y1 < y3 Then
jAC = 3.14159 + Atn((y1 - y3) / (x1 - x3))
ElseIf y1 = y3 Then
jAC = 3.14159
Else
jAC = 3.14159 + Atn((y1 - y3) / (x1 - x3))
End If
End If '以上是讨论角AC在各象限的情况然后各象限的角AC值
j = jAC - jAB
d = Fix((j / 3.14159) * 180)
zfh = Sgn(d)
d = Abs(d)
z1 = Abs((j / 3.14159) * 180) - d
f = Fix(z1 * 60)
m = (z1 * 60 - f) * 60
m = CInt(m)
If m = 60 Then
f = f + 1
m = 0
End If
If f = 60 Then
d = d + 1
f = 0
End If
If zfh < 0 Then
Text7.Text = "-" & Str$(d) & "度" & Str$(f) & "分" & Str$(m) & "秒"
Else
Text7.Text = Str$(d) & "度" & Str$(f) & "分" & Str$(m) & "秒"
End If
s = Sqr((x1 - x3) * (x1 - x3) + (y1 - y3) * (y1 - y3))
Text8.Text = Str$(s)
If x1 = x2 Then
If y1 = y2 Then
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
End If
End If
If x1 = x3 Then
If y1 = y3 Then
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
End If
End If
If x3 = x2 Then
If y3 = y2 Then
MsgBox "注意:后视点与放样点重合", 48, "错误提示"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
End If
End If
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
End Sub
'Private Sub Form_Load()
'Command1.Enabled = False
'Command2.Enabled = False
'Form2.Skin1.LoadSkin ("chizh.skn")
'Skin1.ApplySkin (0)
'End Sub
'Private Sub Text1_Change()
'If Text1.Text <> "" Then
'Command1.Enabled = True
'Command2.Enabled = True
'End If
'End Sub
Private Sub Form_Load()
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -