VERSION 5.00 Begin VB.Form Form1 AutoRedraw = -1 'True Caption = "4" ClientHeight = 5415 ClientLeft = 60 ClientTop = 345 ClientWidth = 7200 LinkTopic = "Form1" ScaleHeight = 5415 ScaleWidth = 7200 StartUpPosition = 3 'Windows Default Begin VB.CheckBox Check1 Caption = "Check1" Height = 225 Left = 5400 TabIndex = 7 ToolTipText = "Включить автообновление" Top = 3960 Width = 225 End Begin VB.Timer Timer1 Left = 1260 Top = 1785 End Begin VB.PictureBox Picture1 Height = 2610 Left = 120 ScaleHeight = 2550 ScaleWidth = 4590 TabIndex = 4 Top = 2565 Width = 4650 Begin VB.Label Label2 Alignment = 2 'Center AutoSize = -1 'True BackStyle = 0 'Transparent Height = 195 Left = 1470 TabIndex = 6 Top = 1920 Width = 75 End Begin VB.Label Label1 Alignment = 2 'Center AutoSize = -1 'True BackStyle = 0 'Transparent Height = 195 Left = 630 TabIndex = 5 Top = 960 Width = 75 End End Begin VB.CommandButton Command4 Caption = "Начертить" Height = 375 Left = 5355 TabIndex = 3 Top = 3840 Width = 1455 End Begin VB.CommandButton Command3 Caption = "Печать2" Height = 375 Left = 5355 TabIndex = 2 Top = 3480 Width = 1455 End Begin VB.CommandButton Command2 Caption = "В&ыход" Height = 375 Left = 5355 TabIndex = 1 Top = 4200 Width = 1455 End Begin VB.CommandButton Command1 Caption = "П&ечать" Height = 375 Left = 5355 TabIndex = 0 Top = 3120 Width = 1455 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Const pi = 3.1415 Const c = 3.14 * 2 Function F(x) F = 3 * Sin(x) * Cos(x / 6) End Function Private Sub Check1_Click() If Check1.Value = 0 Then Timer1.Interval = 0 Else Timer1.Interval = 1000 End Sub Private Sub Command1_Click() Cls DrawWidth = Rnd * 10 + 1 PSet (300, 1000) ForeColor = RGB(230, 250, 100) Circle (1000, 1000), 500 Line (2000, 2000)-(1500, 1500), vbRed, BF Circle (2000, 1000), 800, vbBlue, -0.5, -2, 1 End Sub Private Sub Command2_Click() End End Sub Private Sub Command3_Click() Circle (1000, 1000), 500 Line (1000, 1000)-(2000, 2000) End Sub Private Sub Command4_Click() Label1.Left = -100 Label2.Left = -100 Label1.Caption = "" Label2.Caption = "" miny = 0 maxy = 0 minx = 0 maxx = 0 For x = -2 * pi To 2 * pi Step 0.01 y = F(x) If y < miny Then miny = y minx = x End If If y > maxy Then maxy = y maxx = x End If Next Picture1.Scale (-2 * pi, maxy + 1)-(2 * pi, miny - 1) For x = -2 * pi To 2 * pi Step 0.01 y = F(x) Picture1.PSet (x, y), vbRed For i = 1 To 1000 Next Next DrawWidth = 1 Picture1.FillColor = vbGreen Picture1.FillStyle = 0 Picture1.Circle (minx, miny), 0.1, vbGreen Picture1.Circle (maxx, maxy), 0.1, vbGreen t1 = miny - 1 t2 = maxy + 1 Picture1.Line (-2 * pi, 0)-(2 * pi, 0), vbBlue Picture1.Line (0, t1)-(0, t2), vbBlue Picture1.Line (minx, miny)-(minx, 0), vbBlue Picture1.Line (maxx, maxy)-(maxx, 0), vbBlue t3 = 1827 / Picture1.Height t4 = -0.1 Label1.Left = minx Label1.Top = t3 Label1.Caption = "(" & Format(minx, "0.00") & ";" & Format(miny, "0.00") & ")" Label2.Left = maxx Label2.Top = t4 Label2.Caption = "(" & Format(maxx, "0.00") & ";" & Format(maxy, "0.00") & ")" End Sub Private Sub Label1_dblClick() Picture1.Cls Label1.Caption = "" Label2.Caption = "" End Sub Private Sub Label2_dblClick() Picture1.Cls Label1.Caption = "" Label2.Caption = "" End Sub Private Sub Picture1_DblClick() Picture1.Cls Label1.Caption = "" Label2.Caption = "" End Sub Private Sub Timer1_Timer() Label1.Left = -100 Label2.Left = -100 Label1.Caption = "" Label2.Caption = "" miny = 0 maxy = 0 minx = 0 maxx = 0 For x = -2 * pi To 2 * pi Step 0.01 y = F(x) If y < miny Then miny = y minx = x End If If y > maxy Then maxy = y maxx = x End If Next Picture1.Scale (-2 * pi, maxy + 1)-(2 * pi, miny - 1) For x = -2 * pi To 2 * pi Step 0.01 y = F(x) Picture1.PSet (x, y), vbRed For i = 1 To 1000 Next Next DrawWidth = 1 Picture1.FillColor = vbGreen Picture1.FillStyle = 0 Picture1.Circle (minx, miny), 0.1, vbGreen Picture1.Circle (maxx, maxy), 0.1, vbGreen t1 = miny - 1 t2 = maxy + 1 Picture1.Line (-2 * pi, 0)-(2 * pi, 0), vbBlue Picture1.Line (0, t1)-(0, t2), vbBlue Picture1.Line (minx, miny)-(minx, 0), vbBlue Picture1.Line (maxx, maxy)-(maxx, 0), vbBlue t3 = 1827 / Picture1.Height t4 = -0.1 Label1.Left = minx Label1.Top = t3 Label1.Caption = "(" & Format(minx, "0.00") & ";" & Format(miny, "0.00") & ")" Label2.Left = maxx Label2.Top = t4 Label2.Caption = "(" & Format(maxx, "0.00") & ";" & Format(maxy, "0.00") & ")" End Sub 'Private Sub Command4_Click() 'miny = 0 'maxy = 0 'For x = -2 * pi To 2 * pi Step 0.01 'y = F(x) 'If y < miny Then 'miny = y 'minx = x 'End If 'If y > maxy Then 'maxy = y 'maxx = x 'End If 'Next 'Picture1.Scale (-2 * pi, maxy + 1)-(2 * pi, miny - 1) 'For x = -2 * pi To 2 * pi Step 0.01 'y = F(x) 'Picture1.PSet (x, y), vbRed 'For i = 1 To 1000 'Next 'Next 'DrawWidth = 1 'Picture1.FillColor = vbGreen 'Picture1.FillStyle = 0 'Picture1.Circle (minx, miny), 0.1, vbGreen 'Picture1.Circle (maxx, maxy), 0.1, vbGreen 't1 = miny - 1 't2 = maxy + 1 'Picture1.Line (-2 * pi, 0)-(2 * pi, 0), vbBlue 'Picture1.Line (0, t1)-(0, t2), vbBlue 'Picture1.Line (minx, miny)-(minx, 0), vbBlue 'Picture1.Line (maxx, maxy)-(maxx, 0), vbBlue ''DrawStyle = 3 't3 = maxx * 0.1 't4 = minx * 0.1 'Label1.Left = minx 'Label1.Top = t3 'Label1.Caption = "(" & Format(minx, "0.00") & ";" & Format(miny, "0.00") & ")" ''Label1.Caption = ((minx * 10) \ 1) / 10 'Label2.Left = maxx 'Label2.Top = t4 'Label2.Caption = "(" & Format(maxx, "0.00") & ";" & Format(maxy, "0.00") & ")" ''Label2.Caption = ((maxx * 10) \ 1) / 10 'End Sub Private Sub Command1_Click() miny = 0 maxy = 0 For x = -c To c Step 0.1 y = F(x) If y < miny Then miny = y minx = x End If If y > maxy Then maxy = y maxx = x End If Next Picture1.Scale (-c, maxy + 1)-(c, miny - 1) For x = -c To c Step 0.01 y = F(x) Picture1.PSet (x, y), vbRed Next Picture1.Circle (minx, miny), 0.06, vbYellow Picture1.Circle (maxx, maxy), 0.06, vbYellow Picture1.Line (-c, o)-(c, 0), vbBlue Picture1.Line (0, miny - 1)-(0, maxy + 1), vbBlue Label1.Left = minx Label1.Caption = ((minx * 10) \ 1) / 10 Label2.Left = maxx Label2.Caption = ((maxx * 10) \ 1) / 10 End Sub