大地坐标与工程坐标的相互转换程序
annony
annony Lv.2
2004年07月01日 22:09:52
来自于水利软件
只看楼主

Public x_dadi_o As Double, y_dadi_o As Double, x_daba_o As Double, y_daba_o As Double, j_fangweijiao As DoublePublic x_dadi_p As Double, y_dadi_p As Double, x_daba_p As Double, y_daba_p As DoublePrivate Sub Command1_Click()


Public x_dadi_o As Double, y_dadi_o As Double, x_daba_o As Double, y_daba_o As Double, j_fangweijiao As Double
Public x_dadi_p As Double, y_dadi_p As Double, x_daba_p As Double, y_daba_p As Double

Private Sub Command1_Click()

Call annony_



End Sub

Private Sub Command2_Click()
Text6.Text = ""
Text7.Text = "": Text8.Text = "": Text9.Text = "": Option1.Value = False: Option2.Value = False
Exit Sub
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Command4_Click()
If (Text1.Text = "" Or Text2.Text = "") Or (Text3.Text = "" Or Text4.Text = "") Or (Text5.Text = "" And Text10.Text = "" And Text11.Text = "" And Text12.Text = "") Then
MsgBox "请输入基本参数!", vbOKOnly, "提示"
Exit Sub
End If

x_dadi_o = Val(Text1.Text): y_dadi_o = Val(Text2.Text): x_daba_o = Val(Text3.Text): y_daba_o = Val(Text4.Text)
If Text5.Text = "" Then
j_fangweijiao = (Val(Text10.Text) + Val(Text11.Text) / 60 + Val(Text12.Text) / 3600) * 3.1415926 / 180
Else
j_fangweijiao = Val(Text5.Text) * 3.1415926 / 180
End If
If (Option1.Value = False And Option2.Value = False) Then
MsgBox "请选择计算类型!", vbOKOnly, "提示"
Exit Sub
End If

End Sub

Private Sub Command5_Click()
Text1.Text = "": Text2.Text = "": Text3.Text = "": Text4.Text = "": Text5.Text = "": Text10.Text = "": Text11.Text = "": Text12.Text = ""
End Sub

Private Sub Option1_Click()
If Option1.Value = True Then
Text6.Text = "": Text7.Text = "": Text8.Text = "": Text9.Text = ""
Text6.SetFocus
End If
End Sub

Private Sub Option2_Click()
If Option2.Value = True Then
Text6.Text = "": Text7.Text = "": Text8.Text = "": Text9.Text = ""
End If
Text8.SetFocus
End Sub

Sub annony_()


If (Option1.Value = False And Option2.Value = False) Then
MsgBox "请选择计算类型!", vbOKOnly, "提示"
Exit Sub
End If


If Option2.Value = True Then
If (Text8.Text = "" And Text9.Text = "") Then
MsgBox "请输入已知点P的大坝坐标值!", vbOKOnly, "提示"
Exit Sub
End If

x_daba_p = Val(Text8.Text): y_daba_p = Val(Text9.Text)
dx = x_daba_p - x_daba_o
dy = y_daba_p - y_daba_o

x_dadi_p = x_dadi_o + dx * Cos(j_fangweijiao) - dy * Sin(j_fangweijiao)
y_dadi_p = y_dadi_o + dx * Sin(j_fangweijiao) + dy * Cos(j_fangweijiao)
Text6.Text = Str(Int(x_dadi_p * 1000) * 0.001)
Text7.Text = Str(Int(y_dadi_p * 1000) * 0.001)

ElseIf Option1.Value = True Then

If (Text6.Text = "" And Text7.Text = "") Then
MsgBox "请输入已知点P的大地坐标值!", vbOKOnly, "提示"
Exit Sub
End If

x_dadi_p = Val(Text6.Text): y_dadi_p = Val(Text7.Text)
dx = x_dadi_p - x_dadi_o
dy = y_dadi_p - y_dadi_o

x_daba_p = x_daba_o + dx * Cos(j_fangweijiao) + dy * Sin(j_fangweijiao)
y_daba_p = y_daba_o - dx * Sin(j_fangweijiao) + dy * Cos(j_fangweijiao)
Text8.Text = Str(Int(x_daba_p * 1000) * 0.001)
Text9.Text = Str(Int(y_daba_p * 1000) * 0.001)
End If
End Sub
免费打赏
kkhhdd
2004年07月03日 18:02:52
2楼
好用吗?
回复
sch79ok
2004年07月12日 15:42:52
3楼
不好用
回复
cookie
2004年07月12日 15:45:52
4楼
但愿好用, 不过暂时用不上!!
回复
duxingming@sl
2004年07月13日 09:44:52
5楼
试试再说
回复
cddk
2004年07月13日 16:27:52
6楼
怎么转换呀?
回复
cdut2003@sl
2004年07月13日 16:41:52
7楼
vb啊?
回复

相关推荐

APP内打开