Private Sub Command1_Click()
x0 = Val(Text1.Text)
xk = Val(Text2.Text)
h = Val(Text3.Text)
y0 = Val(Text4.Text)
n = (xk - x0) / h
vsFlexArray1.Rows = n + 2
vsFlexArray1.TextMatrix(0, 0) = "x"
vsFlexArray1.TextMatrix(0, 1) = "Eiler Mod."
vsFlexArray1.TextMatrix(0, 2) = "Rynge-Kytt"
vsFlexArray1.TextMatrix(0, 3) = "Obshee"
Label7.Caption = Str(x0)
Label8.Caption = Str(xk)
EilerMod
Rynge_Kytt
Obshee
max = y0
min = y0
For i = 0 To n
If y(i) > max Then
max = y(i)
End If
If y(i) < min Then
min = y(i)
End If
If g(i) > max Then
max = g(i)
End If
If g(i) < min Then
min = g(i)
End If
If t(i) > max Then
max = t(i)
End If
If t(i) < min Then
min = t(i)
End If
Next i
Label9.Item = Str(max)
Label10.Caption = Str(min)
kx = (6600 - 960) / (xk - x0)
ky = (5160 - 240) / (max - min)
PictureBox1.Cls
For i = 1 To n - 1
X1 = 960 + Round(kx * (x(i - 1) - x0))
X2 = 960 + Round(kx * (x(i) - x0))
Y1 = 5160 - Round(ky * (y(i - 1) - min))
Y2 = 5160 - Round(ky * (y(i) - min))
PictureBox1.Line (X1, Y1)-(X2, Y2), RGB(100, 200, 200)
X1 = 960 + Round(kx * (x(i - 1) - x0))
X2 = 960 + Round(kx * (x(i) - x0))
Y1 = 5160 - Round(ky * (g(i - 1) - min))
Y2 = 5160 - Round(ky * (g(i) - min))
PictureBox1.Line (X1, Y1)-(X2, Y2), RGB(400, 300, 300)
X1 = 960 + Round(kx * (x(i - 1) - x0))
X2 = 960 + Round(kx * (x(i) - x0))
Y1 = 5160 - Round(ky * (t(i - 1) - min))
Y2 = 5160 - Round(ky * (t(i) - min))
PictureBox1.Line (X1, Y1)-(X2, Y2), RGB(500, 100, 100)
Next i
End Sub
x0 = Val(Text1.Text)
xk = Val(Text2.Text)
h = Val(Text3.Text)
y0 = Val(Text4.Text)
n = (xk - x0) / h
vsFlexArray1.Rows = n + 2
vsFlexArray1.TextMatrix(0, 0) = "x"
vsFlexArray1.TextMatrix(0, 1) = "Eiler Mod."
vsFlexArray1.TextMatrix(0, 2) = "Rynge-Kytt"
vsFlexArray1.TextMatrix(0, 3) = "Obshee"
Label7.Caption = Str(x0)
Label8.Caption = Str(xk)
EilerMod
Rynge_Kytt
Obshee
max = y0
min = y0
For i = 0 To n
If y(i) > max Then
max = y(i)
End If
If y(i) < min Then
min = y(i)
End If
If g(i) > max Then
max = g(i)
End If
If g(i) < min Then
min = g(i)
End If
If t(i) > max Then
max = t(i)
End If
If t(i) < min Then
min = t(i)
End If
Next i
Label9.Item = Str(max)
Label10.Caption = Str(min)
kx = (6600 - 960) / (xk - x0)
ky = (5160 - 240) / (max - min)
PictureBox1.Cls
For i = 1 To n - 1
X1 = 960 + Round(kx * (x(i - 1) - x0))
X2 = 960 + Round(kx * (x(i) - x0))
Y1 = 5160 - Round(ky * (y(i - 1) - min))
Y2 = 5160 - Round(ky * (y(i) - min))
PictureBox1.Line (X1, Y1)-(X2, Y2), RGB(100, 200, 200)
X1 = 960 + Round(kx * (x(i - 1) - x0))
X2 = 960 + Round(kx * (x(i) - x0))
Y1 = 5160 - Round(ky * (g(i - 1) - min))
Y2 = 5160 - Round(ky * (g(i) - min))
PictureBox1.Line (X1, Y1)-(X2, Y2), RGB(400, 300, 300)
X1 = 960 + Round(kx * (x(i - 1) - x0))
X2 = 960 + Round(kx * (x(i) - x0))
Y1 = 5160 - Round(ky * (t(i - 1) - min))
Y2 = 5160 - Round(ky * (t(i) - min))
PictureBox1.Line (X1, Y1)-(X2, Y2), RGB(500, 100, 100)
Next i
End Sub