📄 te.frm
字号:
VERSION 5.00
Begin VB.Form Form2
AutoRedraw = -1 'True
Caption = "Form2"
ClientHeight = 2730
ClientLeft = 60
ClientTop = 450
ClientWidth = 4950
LinkTopic = "Form2"
ScaleHeight = 2730
ScaleWidth = 4950
StartUpPosition = 3 '窗口缺省
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
''Me.Scale (0, 1)-(1, -0.7)
''Line (0, -0.6)-(0, 1)
''Line (0, -0.6)-(1, -0.6)
''For i = 1 To 7
'' Line (0, -0.4 + i * 0.2 - 0.2)-(0.05, -0.4 + i * 0.2 - 0.2): Print -0.4 + i * 0.2 - 0.2
''Next i
''For i = 1 To 4
'' Line (0.2 * i, -0.6)-(0.2 * i, -0.5)
''Next i
'Dim x As Double, y(1 To 200) As Double, z(1 To 200) As Double
'Dim di As Double, D(1 To 199) As Double, S As Double, Com As Double
'Open App.Path & "\cof1.txt" For Input As #1
'Open App.Path & "\cof2.txt" For Input As #2
' For i = 1 To 200
' Input #1, y(i): Input #1, x: Input #1, x
' Input #2, z(i): Input #2, x: Input #2, x
' Next i
'Close #2
'Close #1
'x = 0
' For i = 181 To 199
'' Debug.Print z(i)
' di = 10000
' For j = i + 1 To 200
' Com = Abs(y(i) - y(j)) + Abs(z(i) - z(j)) ': Debug.Print Com
' If di > Com Then
' di = Com ': Debug.Print di
' End If
' Next j
' D(i) = di
' di = 10000
' x = x + D(i) ': Debug.Print D(i)
' Next i
'x = x / 19
'Debug.Print Format(x, "0.#####")
'S = 0
'For i = 181 To 199
' S = S + (x - D(i)) ^ 2
'Next i
'S = Sqr(S / 19)
'Debug.Print Format(S, "0.#####")
Me.Scale (-50, 100)-(280, -280)
Line (0, -250)-(0, 50)
CurrentX = -10: CurrentY = 40: Print "f2"
Line (0, -250)-(250, -250)
CurrentX = 240: CurrentY = -255: Print "f1"
For i = -1 To 5
Line (10, -50 * i)-(0, -50 * i)
CurrentX = -35: CurrentY = -50 * i + 10: Print Format(-50 * i, "0.0")
Next i
For i = 1 To 5
Line (50 * i, -245)-(50 * i, -250): Print Format(50 * i, "0.0")
Next i
Dim F1 As Double, F2 As Double, x As Double, y As Double
Dim N As Double, Ny As Double, E As Double
Dim Forf1(1 To 2180) As Single, Forf2(1 To 2180) As Single
Dim Di(1 To 2179) As Double, S As Double, Dia As Double, Ja As Double
N = 0: Ny = 0
Open App.Path & "\f2data.txt" For Input As #1
Do Until EOF(1)
N = N + 1
For i = 1 To 100
Input #1, F1: Input #1, F2: Input #1, x: Input #1, y
Next i
' If (y > 14.79 Or y < 2.5) Then
' Ny = Ny + 1
' End If
Forf1(N) = F1: Forf2(N) = F2
Loop
Close #1
Dia = 0: S = 0
For i = 1 To 2179
Di(i) = 10000
For J = i + 1 To 2180
Ja = (Abs(Forf1(i) - Forf1(J)) + Abs(Forf2(i) - Forf2(J)))
If Di(i) > Ja Then
Di(i) = Ja
End If
Next J
If Di(i) < 1000 Then Dia = Dia + Di(i)
Next i
Dia = Dia / 2179
For i = 1 To 2179
S = S + (Dia - Di(i)) ^ 2
Next i
S = Sqr(S / 2179)
Debug.Print N, S
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -