📄 formbaself.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
Begin VB.Form FormBaselF
Caption = "白塞尔大地主题反算"
ClientHeight = 6090
ClientLeft = 4710
ClientTop = 3495
ClientWidth = 9870
LinkTopic = "Form1"
ScaleHeight = 6090
ScaleMode = 0 'User
ScaleWidth = 9960.828
Begin MSComDlg.CommonDialog CommonDialog1
Left = 8160
Top = 240
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.Frame Frame1
Caption = "批量计算"
Height = 1095
Left = 1200
TabIndex = 18
Top = 4440
Width = 7455
Begin VB.CommandButton Command3
Caption = "文件另存为"
Height = 495
Left = 4320
TabIndex = 20
Top = 360
Width = 1695
End
Begin VB.CommandButton Command2
Caption = "打开文件 -->>>处理"
Height = 495
Left = 840
TabIndex = 19
Top = 360
Width = 2055
End
End
Begin VB.TextBox Text_B1
Height = 375
Left = 1560
TabIndex = 3
Text = "42.32356784 "
Top = 2760
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "立即计算"
Height = 375
Left = 7560
TabIndex = 10
Top = 3840
Width = 1575
End
Begin VB.TextBox Text_B2
Height = 405
Left = 1560
TabIndex = 5
Text = "42.45479027"
Top = 3840
Width = 1575
End
Begin VB.TextBox Text_L2
Height = 405
Left = 3600
TabIndex = 6
Text = "131.3201104 "
Top = 3840
Width = 1695
End
Begin VB.TextBox Text_L1
Height = 405
Left = 3600
TabIndex = 4
Text = "130.10122627"
Top = 2760
Width = 1695
End
Begin VB.TextBox Text_A12
Height = 405
Left = 5640
TabIndex = 9
Top = 2760
Width = 1575
End
Begin VB.TextBox Text_S
Height = 375
Left = 7560
TabIndex = 7
Top = 3240
Width = 1455
End
Begin VB.OptionButton Option1
Caption = "克拉索夫斯基椭球体"
Height = 615
Left = 1200
TabIndex = 0
Top = 1320
Width = 2535
End
Begin VB.OptionButton Option2
Caption = "1975国际椭球体"
Height = 615
Left = 4200
TabIndex = 1
Top = 1320
Width = 2295
End
Begin VB.OptionButton Option3
Caption = "WGS-84椭球体"
Height = 855
Left = 6840
TabIndex = 2
Top = 1200
Width = 2415
End
Begin VB.TextBox Text_A21
Height = 375
Left = 5640
TabIndex = 8
Top = 3840
Width = 1575
End
Begin VB.Label Label1
Caption = "白塞尔反算"
BeginProperty Font
Name = "MS Sans Serif"
Size = 24
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 3840
TabIndex = 17
Top = 240
Width = 3255
End
Begin VB.Label Label2
Caption = "已知点 1"
Height = 255
Left = 600
TabIndex = 16
Top = 2880
Width = 735
End
Begin VB.Label Label3
Caption = "待求点 2"
Height = 375
Left = 600
TabIndex = 15
Top = 3960
Width = 735
End
Begin VB.Label Label4
Caption = "B"
Height = 375
Left = 2280
TabIndex = 14
Top = 2160
Width = 1215
End
Begin VB.Label Label5
Caption = "L"
Height = 495
Left = 4440
TabIndex = 13
Top = 2160
Width = 735
End
Begin VB.Label Label6
Caption = "A"
Height = 615
Left = 6360
TabIndex = 12
Top = 2160
Width = 855
End
Begin VB.Label Label7
Caption = "S"
Height = 375
Left = 8280
TabIndex = 11
Top = 2160
Width = 615
End
Begin VB.Menu Return
Caption = "返回主页"
End
End
Attribute VB_Name = "FormBaselF"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim a As Double
Dim b_b As Double
Dim c As Double
Dim a_a As Double
Dim ee As Double
Dim e_e As Double
Const PI = 3.14159265358979
Const p_p = 206264.806247096
Public BBmat
Dim CCmat() As Variant
Dim dd As Double
Public Function AngleToRadian(angle As Double) As Double '角度化弧度
Dim d As Integer
Dim f As Integer
Dim m As Double
angle = angle + 0.0000000001
d = Int(Abs(angle)) * Sgn(angle)
f = Int(Abs((angle - d) * 100)) * Sgn((angle - d) * 100)
m = ((angle - d) * 100 - f) * 100
'Print d
'Print f
'Print m
AngleToRadian = (CDbl(m) / 3600 + CDbl(f) / 60 + CDbl(d)) * PI / 180
'AngleToRadian = Sgn(angle) * AngleToRadian
'Print AngleToRadian
End Function
Public Function GetW(B As Double) As Double '其中B为弧度 'get W
GetW = Sqr(1 - ee * Sin(B) * Sin(B))
End Function
Public Function GetV(B As Double) As Double '其中B为弧度
GetV = Sqr(1 + e_e * Cos(B) * Cos(B))
'Print B
'Print e_e
'Print Sqr(1 + e_e * Cos(B) * Cos(B))
End Function
Public Function GetM(B As Double) As Double '其中B为弧度
Dim V As Double
V = GetV(B)
GetM = c / (V * V * V)
End Function
Public Function GetN(B As Double) As Double '其中B为弧度
Dim V As Double
V = GetV(B)
GetN = c / V
End Function
Public Function Gett(B As Double) As Double '其中B为弧度
Gett = Tan(B)
End Function
Public Function Getnn(B As Double) As Double '其中B为弧度
Getnn = e_e * Cos(B) * Cos(B)
End Function
Public Function RadianToAngle(radian As Double) As Double '弧度化角度
Dim angle As Double
Dim d As Double
Dim f As Double
Dim m As Double
Do While (radian > (2 * PI))
radian = radian - 2 * PI
Loop
'Do While (radian < 0)
'radian = radian + 2 * PI
'Loop
angle = radian * 180 / PI
d = Int(Abs(angle)) * Sgn(angle)
f = Int(Abs((angle - d) * 60)) * Sgn((angle - d) * 60)
m = ((angle - d) * 60 - f) * 60
'Print d
'Print f
'Print m
RadianToAngle = CDbl(d) + CDbl(f) / 100 + m / 10000
'RadianToAngle = Sgn(radian) * RadianToAngle
End Function
Private Sub Command1_Click()
If (e_e = 0) Then
MsgBox ("请选择椭球体的类型")
ElseIf (Text_B1.Text = "") Then
MsgBox ("请填入已知点1的纬度值")
ElseIf (Text_L1.Text = "") Then
MsgBox ("请填入已知点1的经度值")
ElseIf (Text_B2.Text = "") Then
MsgBox ("请填入已知点2的纬度值")
ElseIf (Text_L2.Text = "") Then
MsgBox ("请填入已知点2的经度值")
Else
Dim A12, A21, S As Double
Dim W1, W2, sin_u1, sin_u2, cos_u1, cos_u2, L, B1, B2, L1, L2, a_1, b_1, a_2, b_2, oo0, oo, yy, p, q, sin_o, cos_o, o, sin_A0, x, aaa, bbb, AA, BB, CC As Double
B1 = AngleToRadian(Val(Text_B1.Text)) ': Print B1
L1 = AngleToRadian(Val(Text_L1.Text)) ': Print L1
B2 = AngleToRadian(Val(Text_B2.Text)) ': Print B2
L2 = AngleToRadian(Val(Text_L2.Text)) ': Print L2
W1 = GetW(B1 + 0): W2 = GetW(B2 + 0)
sin_u1 = Sin(B1) * Sqr(1 - ee) / W1: sin_u2 = Sin(B2) * Sqr(1 - ee) / W2
cos_u1 = Cos(B1) / W1: cos_u2 = Cos(B2) / W2
L = L2 - L1
a_1 = sin_u1 * sin_u2: a_2 = cos_u1 * cos_u2
b_1 = cos_u1 * sin_u2: b_2 = sin_u1 * cos_u2
oo0 = 0
aaaa: yy = L + oo0
p = cos_u2 * Sin(yy): q = b_1 - b_2 * Cos(yy)
A12 = Atn(p / q)
If (p >= 0 And q >= 0) Then
A12 = Abs(A12)
ElseIf (p >= 0 And q < 0) Then
A12 = PI - Abs(A12)
ElseIf (p < 0 And q < 0) Then
A12 = PI + Abs(A12)
Else
A12 = 2 * PI - Abs(A12)
End If
sin_o = p * Sin(A12) + q * Cos(A12): cos_o = a_1 + a_2 * Cos(yy)
o = Atn(sin_o / cos_o)
If (cos_o >= 0) Then
o = Abs(o)
Else
o = PI - Abs(o)
End If
sin_A0 = cos_u1 * Sin(A12)
cos_A0_2 = 1 - sin_A0 * sin_A0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -