VERSION 5.00 Begin VB.Form Form2 BackColor = &H00FF8080& Caption = "Визуализация метода" ClientHeight = 6660 ClientLeft = 60 ClientTop = 450 ClientWidth = 8550 LinkTopic = "Form2" ScaleHeight = 6660 ScaleWidth = 8550 StartUpPosition = 3 'Windows Default Begin VB.CommandButton Command2 Caption = "Возврат" Height = 495 Left = 2040 TabIndex = 2 Top = 6120 Width = 1455 End Begin VB.PictureBox Picture1 BackColor = &H8000000E& Height = 5535 Left = 240 ScaleHeight = 5475 ScaleWidth = 7755 TabIndex = 1 Top = 360 Width = 7815 Begin VB.Label Label5 BackColor = &H8000000E& Height = 255 Left = 3120 TabIndex = 7 Top = 5040 Width = 375 End Begin VB.Label Label4 BackColor = &H8000000E& Height = 375 Left = 2400 TabIndex = 6 Top = 5040 Width = 495 End Begin VB.Label Label3 BackColor = &H8000000E& Height = 255 Left = 1560 TabIndex = 5 Top = 5160 Width = 375 End Begin VB.Label Label2 BackColor = &H8000000E& Height = 255 Left = 720 TabIndex = 4 Top = 5160 Width = 495 End Begin VB.Label Label1 BackColor = &H8000000E& Height = 375 Left = 240 TabIndex = 3 Top = 5040 Width = 255 End End Begin VB.CommandButton Command1 Caption = "Построить" Height = 615 Left = 5760 TabIndex = 0 Top = 6000 Width = 1575 End End Attribute VB_Name = "Form2" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Sub Command1_Click() minx = 0: miny = 0: maxx = 0: maxy = 0 For x = a To b Step 0.01 Y = fn(x) If Y < miny Then miny = Y minx = x End If If Y > maxy Then maxy = Y maxx = x End If Next Print maxy 'Print miny 'Print maxx 'Print minx Picture1.Scale (-1.25, maxy + 0.006)-(b + 2, miny - 0.009) Picture1.Line (minx, miny)-(b + 2, miny) Picture1.Line (0, miny)-(0, maxy + 0.006) Label1.AutoSize = True Label1.Left = a - 0.25 Label1.Top = miny - 0.002 f = a Label1.Caption = "a =" + Str(f) Label2.AutoSize = True Label2.Left = b - 0.25 Label2.Top = miny - 0.002 f = b Label2.Caption = "b =" + Str(f) Label3.AutoSize = True Label3.Left = b + 1.8 Label3.Top = miny - 0.002 Label3.Caption = "X" Label4.AutoSize = True Label4.Left = -0.3 Label4.Top = maxy + 0.004 Label4.Caption = "Y" Picture1.Line (a, 0.001)-(a, -0.001) Picture1.Line (b, 0.001)-(b, -0.001) 'If fn(x) = maxy Then 'Label5.AutoSize = True 'Label5.Left = -0.45 'Label5.Top = maxy 'Label5.Caption = "maxy=" + Format(maxy, "00.0") 'End If 'Label2.Caption = b 'Print Label2 ' Picture1.FillStyle = 2 'Picture1.FillColor = vbRed For x = a To b Step 0.01 h = 0.01 Picture1.Line (x, fn(x))-(x + h, fn(x + h)), vbRed For i = 1 To 100000 Next Next h = (b - a) / k For x = a To b - h Step h Picture1.Line (x, miny)-(x, fn(x)), vbGreen Picture1.Line (x, fn(x))-(x + h, fn(x + h)), vbGreen Picture1.Line (x + h, fn(x + h))-(x + h, miny), vbGreen For i = 1 To 10000000 Next Next For x = a To (a + b) / 2 Step h Picture1.Line (-0.05, fn(x))-(x, fn(x)) Picture1.CurrentX = -0.75 Picture1.CurrentY = fn(x) + 0.001 Picture1.Print Format(fn(x), "0.0000") Next 'For x = a + h To b / 2 Step h 'Picture1.Line (x, 0.001)-(x, -0.001) 'Picture1.CurrentX = x - 0.2 ' Picture1.CurrentY = miny - 0.002 ' Picture1.Print x ' Next Picture1.Line (b - h, miny)-(b - h, fn(b - h)), vbGreen Picture1.Line (b - h, fn(b - h))-(b, fn(b)), vbGreen Picture1.Line (b, fn(b))-(b, miny), vbGreen End Sub Private Sub Command2_Click() Form2.Hide Form1.Show End Sub