📄 formbaselz.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
Begin VB.Form FormBaselZ
Caption = "白塞尔大地主题正算"
ClientHeight = 6090
ClientLeft = 4710
ClientTop = 3375
ClientWidth = 9780
LinkTopic = "Form1"
ScaleHeight = 6090
ScaleWidth = 9780
Begin MSComDlg.CommonDialog CommonDialog1
Left = 7800
Top = 360
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.Frame Frame1
Caption = "批量计算"
Height = 1095
Left = 840
TabIndex = 18
Top = 4320
Width = 7935
Begin VB.CommandButton Command3
Caption = "文件另存为"
Height = 495
Left = 4560
TabIndex = 20
Top = 360
Width = 1575
End
Begin VB.CommandButton Command2
Caption = "打开文件 -->>>处理"
Height = 495
Left = 1200
TabIndex = 19
Top = 360
Width = 1815
End
End
Begin VB.TextBox Text_B1
Height = 375
Left = 1560
TabIndex = 4
Text = "42.31356874"
Top = 2640
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "立即计算"
Height = 375
Left = 7560
TabIndex = 8
Top = 3720
Width = 1575
End
Begin VB.TextBox Text_B2
Height = 405
Left = 1560
TabIndex = 10
Top = 3720
Width = 1575
End
Begin VB.TextBox Text_L2
Height = 405
Left = 3600
TabIndex = 9
Top = 3720
Width = 1695
End
Begin VB.TextBox Text_L1
Height = 405
Left = 3600
TabIndex = 5
Text = "130.10122676 "
Top = 2640
Width = 1695
End
Begin VB.TextBox Text_A12
Height = 405
Left = 5640
TabIndex = 6
Text = "1.4943"
Top = 2640
Width = 1575
End
Begin VB.TextBox Text_S
Height = 375
Left = 7560
TabIndex = 7
Text = "140000"
Top = 3120
Width = 1455
End
Begin VB.OptionButton Option1
Caption = "克拉索夫斯基椭球体"
Height = 615
Left = 1200
TabIndex = 1
Top = 1320
Width = 2535
End
Begin VB.OptionButton Option2
Caption = "1975国际椭球体"
Height = 615
Left = 4200
TabIndex = 2
Top = 1320
Width = 2295
End
Begin VB.OptionButton Option3
Caption = "WGS-84椭球体"
Height = 855
Left = 6840
TabIndex = 3
Top = 1200
Width = 2415
End
Begin VB.TextBox Text_A21
Height = 375
Left = 5640
TabIndex = 0
Top = 3720
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 = 3720
TabIndex = 17
Top = 240
Width = 3255
End
Begin VB.Label Label2
Caption = "已知点 1"
Height = 255
Left = 600
TabIndex = 16
Top = 2760
Width = 735
End
Begin VB.Label Label3
Caption = "待求点 2"
Height = 375
Left = 600
TabIndex = 15
Top = 3840
Width = 735
End
Begin VB.Label Label4
Caption = "B"
Height = 375
Left = 2280
TabIndex = 14
Top = 2040
Width = 1215
End
Begin VB.Label Label5
Caption = "L"
Height = 495
Left = 4440
TabIndex = 13
Top = 2040
Width = 735
End
Begin VB.Label Label6
Caption = "A"
Height = 615
Left = 6360
TabIndex = 12
Top = 2040
Width = 855
End
Begin VB.Label Label7
Caption = "S"
Height = 375
Left = 8280
TabIndex = 11
Top = 2040
Width = 615
End
Begin VB.Menu Return
Caption = "返回主页"
End
End
Attribute VB_Name = "FormBaselZ"
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 = 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.000000000001
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为弧度 get V
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为弧度 get M
Dim V As Double
V = GetV(B)
GetM = c / (V * V * V)
End Function
Public Function GetN(B As Double) As Double '其中B为弧度 get N
Dim V As Double
V = GetV(B)
GetN = c / V
End Function
Public Function Gett(B As Double) As Double '其中B为弧度 get t
Gett = Tan(B)
End Function
Public Function Getnn(B As Double) As Double '其中B为弧度 get nn
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
RadianToAngle = CDbl(d) + CDbl(f) / 100 + m / 10000
'RadianToAngle = Sgn(radian) * RadianToAngle
End Function
Private Sub Command1_Click()
If (b_b = 0) Then
MsgBox ("请选择椭球体的类型")
ElseIf (Text_B1.Text = "") Then
MsgBox ("请填入已知点的纬度值")
ElseIf (Text_L1.Text = "") Then
MsgBox ("请填入已知点的经度值")
ElseIf (Text_A12.Text = "") Then
MsgBox ("请填入已知点的大地方位角值")
ElseIf (Text_S.Text = "") Then
MsgBox ("请填入已知点的大地线长度")
Else
Dim B1, L1, A12, S As Double
Dim W1, sin_u1, cos_u1, sin_A0, cos_A0_2, cot_o1, sin_2o1, cos_2o1 As Double '(1)(2)
Dim AA, BB, CC, aaa, bbb As Double '(3)
Dim o0, sin_2o1r0, cos_2o1r0, o, kk As Double '(4)
Dim oo, sin_u2, B2, yy, L2, A21 '(5)(6)
B1 = AngleToRadian(Val(Text_B1.Text)) ': Print B1
L1 = AngleToRadian(Val(Text_L1.Text)) ': Print L1
A12 = AngleToRadian(Val(Text_A12.Text)) ': Print A12
S = Val(Text_S.Text)
W1 = GetW(AngleToRadian(Val(Text_B1.Text)))
sin_u1 = Sin(B1) * Sqr(1 - ee) / W1
cos_u1 = Cos(B1) / W1
sin_A0 = cos_u1 * Sin(A12): cot_o1 = cos_u1 * Cos(A12) / sin_u1: sin_2o1 = 2 * cot_o1 / (cot_o1 * cot_o1 + 1): cos_2o1 = (cot_o1 * cot_o1 - 1) / (cot_o1 * cot_o1 + 1)
cos_A0_2 = 1 - sin_A0 * sin_A0
kk = e_e * cos_A0_2
'k = Sqr(kk)
AA = b_b * (1 + kk / 4 - 3 * kk * kk / 64 + 5 * kk * kk * kk / 256)
BB = b_b * (kk / 8 - kk * kk / 32 + 15 * kk * kk * kk / 1024)
CC = b_b * (kk * kk / 128 - 3 * kk * kk * kk / 512)
aaa = (ee / 2 + ee * ee / 8 + ee * ee * ee / 16 + ee * ee * ee * ee / 32) - (ee * ee / 16 + ee * ee * ee / 16 + ee * ee * ee * ee / 16) * cos_A0_2 + (3 * ee * ee * ee / 128) * cos_A0_2 * cos_A0_2
bbb = (ee * ee / 32 + ee * ee * ee / 32 + ee * ee * ee * ee / 32) * cos_A0_2 - (ee * ee * ee / 64) * cos_A0_2 * cos_A0_2
o0 = (S - (BB + CC * cos_2o1) * sin_2o1) / (AA + 1E-16)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -