用VB程序怎么做出高斯投影分带计算程序?
- 提问者网友:溺爱和你
- 2021-05-18 06:29
- 五星知识达人网友:毛毛
- 2021-05-18 07:04
按照图片添加控件,复制一下代码即可运行
Dim x, y, b, L As Integer
Private Sub Command1_Click()
Dim x, y, L0, b1, c, bf, bf1, bf2, nf, z, b2, b3, b4, b5, b, L, l1 As Variant
x = Val(Text1.Text)
y = Val(Text2.Text)
L0 = Val(Text3.Text)
b1 = (x / 6367452.1328)
c = Cos(b1) * Cos(b1)
bf = b1 * 206264.806247096 + (52289760 + (2936975 + (2383 + 22 * c) * c) * c) * Sin(b1) * Cos(b1) / 10 ^ (10)
bf1 = bf / 206264.806247096
bf2 = Cos(bf1) * Cos(bf1)
nf = 6399596.652 - (21565.045 - (108.996 - 0.603 * bf2) * bf2) * bf2
z = y / (nf * Cos(bf1))
b2 = (0.5 + 0.00336975 * bf2) * Sin(bf1) * Cos(bf1)
b3 = 0.3333333 - (0.1666667 - 0.001123 * bf2) * bf2
b4 = 0.25 + (0.161612 + 0.005617 * bf2) * bf2
b5 = 0.2 - (0.16667 - 0.00878 * bf2) * bf2
b = bf - (1 - (b4 - 0.147 * z * z) * z * z) * z * z * b2 * 206264.806247096
L = (1 - (b3 - b5 * z * z) * z * z) * z * 206264.806247096
l1 = L0 * 3600 + L
Debug.Print l1
Debug.Print b
Dim l2, b6, c1, n, a0, a4, a6, a3, a5, x1, y1 As Variant
l2 = (l1 - Val(Text4.Text) * 3600) / 206264.806247096
b6 = b / 206264.806247096
c1 = Cos(b6) * Cos(b6)
n = 6399596.652 - (21565.045 - (108.996 - 0.603 * c1) * c1) * c1
a0 = 32144.5189 - (135.3646 - (0.7034 - 0.0041 * c1) * c1) * c1
a4 = (0.25 + 0.00253 * c1) * c1 - 0.04167
a6 = (0.167 * c1 - 0.083) * c1
a3 = (0.3333333 + 0.001123 * c1) * c1 - 0.1666667
a5 = 0.00878 - (0.1702 - 0.20382 * c1) * c1
x1 = 6367452.1328 * b / 206264.806247096 - (a0 - (0.5 + (a4 + a6 * l2 * l2) * l2 * l2) * l2 * l2 * n) * Cos(b6) * Sin(b6)
y1 = (1 + (a3 + a5 * l2 * l2) * l2 * l2) * l2 * n * Cos(b6)
Debug.Print x
Debug.Print y
Text5.Text = x1
Text6.Text = y1
End Sub
Private Sub Command3_Click()
Dim x, y, L0, b1, c, bf, bf2, bf1, nf, z, b2, b3, b4, b5, b, L, l1 As Variant
'可氏
x = Val(Text1.Text)
y = Val(Text2.Text)
L0 = Val(Text3.Text)
b1 = (x / 6367558.4969)
c = Cos(b1) * Cos(b1)
bf = b1 * 206264.806247096 + (50221746 + (293622 + (2350 + 22 * c) * c) * c) * Sin(b1) * Cos(b1) / 10 ^ (10)
bf1 = bf / 206264.806247096
bf2 = Cos(bf1) * Cos(bf1)
nf = 6399698.902 - (21562.267 - (108.973 - 0.612 * bf2) * bf2) * bf2
z = y / (nf * Cos(bf1))
b2 = (0.5 + 0.003369 * bf2) * Sin(bf1) * Cos(bf1)
b3 = 0.333333 - (0.166667 - 0.001123 * bf2) * bf2
b4 = 0.25 + (0.161612 + 0.00562 * bf2) * bf2
b5 = 0.2 - (0.1667 - 0.0088 * bf2) * bf2
b = bf - (1 - (b4 - 0.12 * z * z) * z * z) * z * z * b2 * 206264.806247096
L = (1 - (b3 - b5 * z * z) * z * z) * z * 206264.806247096
l1 = L0 * 3600 + L
Debug.Print l1
Debug.Print b
Dim l2, b6, c1, n, a0, a4, a6, a3, a5, x1, y1 As Variant
l2 = (l1 - Val(Text4.Text) * 3600) / 206264.806247096
b6 = b / 206264.806247096
c1 = Cos(b6) * Cos(b6)
n = 6399698.902 - (21562.267 - (108.973 - 0.612 * c1) * c1) * c1
a0 = 32140.404 - (135.3302 - (0.7092 - 0.004 * c1) * c1) * c1
a4 = (0.25 + 0.00252 * c1) * c1 - 0.04166
a6 = (0.166 * c1 - 0.084) * c1
a3 = (0.3333333 + 0.001123 * c1) * c1 - 0.1666667
a5 = 0.0083 - (0.1667 - (0.1968 + 0.004 * c1 * c1) * c1 * c1) * c1 * c1
x1 = 6367558.4969 * b / 206264.806247096 - (a0 - (0.5 + (a4 + a6 * l2 * l2) * l2 * l2) * l2 * l2 * n) * Cos(b6) * Sin(b6)
y1 = (1 + (a3 + a5 * l2 * l2) * l2 * l2) * l2 * n * Cos(b6)
Debug.Print x
Debug.Print y
Text5.Text = x1
Text6.Text = y1
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
End Sub
Private Sub Command2_Click()
End
End Sub