Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Grafico - Form1.frm

Form1.frm

Caricato da:
Scarica il programma completo

  1. Const minX As Single = -1
  2. Const maxX As Single = 4
  3. Const minY As Single = -1
  4. Const maxY As Single = 4
  5.  
  6. Dim x As Single
  7. Dim y As Single
  8.  
  9. Private Sub Command1_Click()
  10. DisegnaAssi
  11. For x = minX To maxX Step (maxX - minX) / Picture1.Width
  12.  If Check1(0) = 1 Then
  13.   If x > 0 Then
  14.    y = Log(x)
  15.    If y >= minY And y <= maxY Then
  16.     Picture1.PSet (x, y), RGB(255, 0, 0)
  17.    End If
  18.   End If
  19.  End If
  20.  If Check1(1) = 1 Then
  21.   If x > 0 Then
  22.    y = x ^ (1 / 4)
  23.     If y >= minY And y <= maxY Then
  24.      Picture1.PSet (x, y), RGB(255, 0, 0)
  25.     End If
  26.   End If
  27.  End If
  28.  If Check1(2) = 1 Then
  29.   If x > 0 Then
  30.     y = x ^ (1 / 2)
  31.     If y >= minY And y <= maxY Then
  32.      Picture1.PSet (x, y), RGB(255, 0, 0)
  33.     End If
  34.   End If
  35.  End If
  36.  If Check1(3) = 1 Then
  37.   y = x
  38.    If y >= minY And y <= maxY Then
  39.     Picture1.PSet (x, y), RGB(255, 0, 0)
  40.    End If
  41.  End If
  42.  If Check1(4) = 1 Then
  43.   y = x ^ 2
  44.    If y >= minY And y <= maxY Then
  45.     Picture1.PSet (x, y), RGB(255, 0, 0)
  46.    End If
  47.  End If
  48.  If Check1(5) = 1 Then
  49.   y = x ^ 4
  50.    If y >= minY And y <= maxY Then
  51.     Picture1.PSet (x, y), RGB(255, 0, 0)
  52.    End If
  53.  End If
  54.  If Check1(6) = 1 Then
  55.   y = Exp(x)
  56.    If y >= minY And y <= maxY Then
  57.     Picture1.PSet (x, y), RGB(255, 0, 0)
  58.    End If
  59.  End If
  60. Next x
  61. End Sub
  62.  
  63. Private Sub Command2_Click()
  64. Picture1.Cls
  65. DisegnaAssi
  66. End Sub
  67.  
  68. Private Sub Form_Load()
  69. Picture1.Cls
  70. Picture1.Scale (minX, maxX)-(maxY, minY)
  71. End Sub
  72.  
  73. Public Sub DisegnaAssi()
  74. Picture1.Line (minX, 0)-(maxX, 0), RGB(0, 0, 255)
  75. Picture1.Line (0, minY)-(0, maxY), RGB(0, 0, 255)
  76. For x = minX To maxX Step 1
  77.  Picture1.Line (x, -0.1)-(x, 0.1), RGB(0, 0, 255)
  78.  Picture1.CurrentX = x
  79.  Picture1.CurrentY = -0.1
  80.  Picture1.Print x
  81. Next x
  82. For y = minY To maxY Step 1
  83.  Picture1.Line (-0.1, y)-(0.1, y), RGB(0, 0, 255)
  84.  Picture1.CurrentX = -0.1
  85.  Picture1.CurrentY = y
  86.  Picture1.Print y
  87. Next y
  88. End Sub