📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 5190
ClientLeft = 60
ClientTop = 450
ClientWidth = 7590
LinkTopic = "Form1"
ScaleHeight = 5190
ScaleWidth = 7590
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "exit"
Height = 495
Left = 4920
TabIndex = 11
Top = 3840
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "calculate"
Height = 495
Left = 2040
TabIndex = 10
Top = 3840
Width = 1215
End
Begin VB.TextBox Texth
Height = 615
Left = 2640
TabIndex = 9
Top = 2760
Width = 735
End
Begin VB.TextBox Textv
Height = 495
Left = 4920
TabIndex = 7
Top = 1800
Width = 975
End
Begin VB.TextBox Texti
Height = 615
Left = 1920
TabIndex = 5
Top = 1680
Width = 855
End
Begin VB.TextBox Texta
Height = 735
Left = 4920
TabIndex = 3
Top = 720
Width = 1215
End
Begin VB.TextBox Texts
Height = 495
Left = 2040
TabIndex = 1
Top = 720
Width = 735
End
Begin VB.Label Label5
Caption = "高差h"
Height = 495
Left = 1320
TabIndex = 8
Top = 2760
Width = 615
End
Begin VB.Label Label4
Caption = "棱镜 高v"
Height = 495
Left = 3600
TabIndex = 6
Top = 1800
Width = 615
End
Begin VB.Label Label3
Caption = "仪器高i"
Height = 615
Left = 720
TabIndex = 4
Top = 1560
Width = 735
End
Begin VB.Label Label2
Caption = "竖直角a"
Height = 615
Left = 3600
TabIndex = 2
Top = 720
Width = 855
End
Begin VB.Label Label1
Caption = "距离s"
Height = 375
Left = 720
TabIndex = 0
Top = 720
Width = 735
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Sub CmdCalculate_Click()
Dim h As Double
Dim s As Double
Dim i As Double
Dim v As Double
Dim a As Double
s = Texts.Text
a = Texta.Text
i = Texti.Text
v = Textv.Text
Call DmsToRad(a)
h = s * Tan(a) + i - v
Text5.Text = h
End Sub
Sub DmsToRad(a As Double) '角度化弧度
Dim g_pi As Double
g_pi = 3.1415926535
Dim t1 As Double
Dim t2 As Double
Dim T3 As Double
Dim T4 As Double
Dim T5 As Double
Dim t As Double
If Abs(a) < 1E-24 Then
t = 1
Else
t = a / Abs(a)
End If
t1 = Abs(a)
t2 = Int(t1 + 0.0000001)
T3 = (t1 - t2) * 100#
T4 = Int(T3 + 0.0000001)
T5 = (t2 + T4 / 60# + (T3 - T4) / 36#) * g_pi / 180#
a = T5 * t
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -