📄 translator.frm
字号:
VERSION 5.00
Begin VB.Form translator
Caption = "坐标转换工具"
ClientHeight = 3015
ClientLeft = 60
ClientTop = 420
ClientWidth = 5205
LinkTopic = "Form1"
ScaleHeight = 3015
ScaleWidth = 5205
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox gulat
Height = 375
Left = 2880
TabIndex = 7
Top = 2400
Width = 1935
End
Begin VB.TextBox gulgt
Height = 375
Left = 2880
TabIndex = 6
Top = 1800
Width = 1935
End
Begin VB.CommandButton caculate
Caption = "解算"
Height = 615
Left = 240
TabIndex = 5
Top = 1800
Width = 735
End
Begin VB.PictureBox Picture1
Height = 1455
Left = 3480
Picture = "translator.frx":0000
ScaleHeight = 1395
ScaleWidth = 1515
TabIndex = 4
Top = 120
Width = 1575
End
Begin VB.TextBox lat
Height = 375
Left = 1800
TabIndex = 1
Top = 840
Width = 1455
End
Begin VB.TextBox lgt
Height = 375
Left = 1800
TabIndex = 0
Top = 240
Width = 1455
End
Begin VB.Label gup2
Caption = "高斯克吕格坐标系下纵坐标(米):"
Height = 495
Left = 1200
TabIndex = 9
Top = 2400
Width = 1455
End
Begin VB.Label gup1
Caption = "高斯克吕格坐标系下横坐标(米):"
Height = 375
Left = 1200
TabIndex = 8
Top = 1800
Width = 1575
End
Begin VB.Label lap
Caption = "请输入纬度(度):"
Height = 375
Left = 120
TabIndex = 3
Top = 960
Width = 1815
End
Begin VB.Label lgp
Caption = "请输入经度(度):"
Height = 375
Left = 120
TabIndex = 2
Top = 360
Width = 1575
End
End
Attribute VB_Name = "translator"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub caculate_Click()
Dim intlogi As Double
Dim intlati As Double
Dim pie As Double
Dim a As Double
Dim e As Double
Dim e1 As Double
Dim n0 As Integer
Dim b As Double
Dim l As Double
Dim l0 As Double
Dim t As Double
Dim c As Double
Dim ai As Double
Dim m As Double
Dim n As Double
Dim FE As Double
Dim k As Double
Dim x As Double
Dim y As Double
intlogi = CDbl(lgt.Text)
intlati = CDbl(lat.Text)
pie = 3.14159265358979
a = 6378245
e = 0.006738525414
e1 = 0.006693421623
If ((intlogi Mod 6) <> 0) Then
n0 = Int(intlogi / 6) + 1
Else
n0 = Int(intlogi / 6)
End If
b = intlati * pie / 180
l0 = n0 * 6 - 3
l = 0
t = Math.Tan(b) * Math.Tan(b)
c = e1 * e1 * Math.Cos(b) * Math.Cos(b)
ai = ((intlogi - l0) * pie / 180) * Math.Cos(b)
m = a * ((1 - e * e / 4 - 3 * e * e * e * e / 64 - 5 * e * e * e * e * e * e / 256) * b - (3 * e * e / 8 + 3 * e * e * e * e / 32 + 45 * e * e * e * e * e * e / 1024) * Math.Sin(2 * b) + (15 * e * e * e * e / 256 + 45 * e * e * e * e * e * e / 1024) * Math.Sin(4 * b) - (35 * e * e * e * e * e * e / 3072) * Math.Sin(6 * b))
n = a / Math.Sqr(1 - e * e * Math.Sin(b) * Math.Sin(b))
FE = 500000 + n0 * 1000000
k = 1
x = k * (m + n * Math.Tan(b) * (ai * ai / 2 + (5 - t + 9 * c + 4 * c * c) * ai * ai * ai * ai / 24) + (61 - 58 * t + t * t + 270 * c - 330 * t * c) * ai * ai * ai * ai * ai * ai / 720)
y = FE + k * n * (ai + (1 - t + c) * ai * ai * ai / 6 + (5 - 18 * t + t * t + 14 * c - 58 * t * c) * ai * ai * ai * ai * ai / 120)
gulgt.Text = y
gulat.Text = x
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -