|
Const minX As Single = -1
Const maxX As Single = 4
Const minY As Single = -1
Const maxY As Single = 4
Dim x As Single
Dim y As Single
Private Sub Command1_Click()
DisegnaAssi
For x = minX To maxX Step (maxX - minX) / Picture1.Width
If Check1(0) = 1 Then
If x > 0 Then
y = Log(x)
If y >= minY And y <= maxY Then
Picture1.PSet (x, y), RGB(255, 0, 0)
End If
End If
End If
If Check1(1) = 1 Then
If x > 0 Then
y = x ^ (1 / 4)
If y >= minY And y <= maxY Then
Picture1.PSet (x, y), RGB(255, 0, 0)
End If
End If
End If
If Check1(2) = 1 Then
If x > 0 Then
y = x ^ (1 / 2)
If y >= minY And y <= maxY Then
Picture1.PSet (x, y), RGB(255, 0, 0)
End If
End If
End If
If Check1(3) = 1 Then
y = x
If y >= minY And y <= maxY Then
Picture1.PSet (x, y), RGB(255, 0, 0)
End If
End If
If Check1(4) = 1 Then
y = x ^ 2
If y >= minY And y <= maxY Then
Picture1.PSet (x, y), RGB(255, 0, 0)
End If
End If
If Check1(5) = 1 Then
y = x ^ 4
If y >= minY And y <= maxY Then
Picture1.PSet (x, y), RGB(255, 0, 0)
End If
End If
If Check1(6) = 1 Then
y = Exp(x)
If y >= minY And y <= maxY Then
Picture1.PSet (x, y), RGB(255, 0, 0)
End If
End If
Next x
End Sub
Private Sub Command2_Click()
Picture1.Cls
DisegnaAssi
End Sub
Private Sub Form_Load()
Picture1.Cls
Picture1.Scale (minX, maxX)-(maxY, minY)
End Sub
Public Sub DisegnaAssi()
Picture1.Line (minX, 0)-(maxX, 0), RGB(0, 0, 255)
Picture1.Line (0, minY)-(0, maxY), RGB(0, 0, 255)
For x = minX To maxX Step 1
Picture1.Line (x, -0.1)-(x, 0.1), RGB(0, 0, 255)
Picture1.CurrentX = x
Picture1.CurrentY = -0.1
Picture1.Print x
Next x
For y = minY To maxY Step 1
Picture1.Line (-0.1, y)-(0.1, y), RGB(0, 0, 255)
Picture1.CurrentX = -0.1
Picture1.CurrentY = y
Picture1.Print y
Next y
End Sub
|
|