Dim X1 As Double
Dim Y1 As Double
Dim Z1 As Double
Dim X2 As Double
Dim Y2 As Double
Dim Z2 As Double
Dim X As Double
Dim Y As Double
Dim I As Integer
Private Sub cmdSOL_Click()
X1 = txtX1.Text
Y1 = txtY1.Text
Z1 = txtZ1.Text
X2 = txtX2.Text
Y2 = txtY2.Text
Z2 = txtZ2.Text
X = (Y1 * Z2 - Z1 * Y2) / (X2 * Y1 - X1 * Y2)
Y = (Z1 * X2 - X1 * Z2) / (X2 * Y1 - X1 * Y2)
txtX.Text = X
txtY.Text = Y
End Sub
Private Sub Command1_Click()
Picture1.Cls
X1 = txtX1.Text
Y1 = txtY1.Text
Z1 = txtZ1.Text
X2 = txtX2.Text
Y2 = txtY2.Text
Z2 = txtZ2.Text
Picture1.ForeColor = vbBlack
Picture1.DrawWidth = 3
Picture1.FillStyle = vbSolid
Picture1.FillColor = vbRed
Picture1.Scale (-10, 10)-(10, -10)
Picture1.Line (-10, 0)-(10, 0)
Picture1.Line (0, 10)-(0, -10)
For I = -9 To 9
Picture1.Line (I, -0.3)-(I, 0.3)
Picture1.Line (-0.3, I)-(0.3, I)
Picture1.Circle (I, 0), 0.15
Picture1.Circle (0, I), 0.15
Next I
Picture1.ForeColor = vbBlue
X = -10
Y = (Z1 - X * X1) / Y1
Picture1.CurrentX = X
Picture1.CurrentY = Y
For X = -10 To 10
Y = (Z1 - X * X1) / Y1
Picture1.Line -(X, Y)
Picture1.Circle (X, Y), 0.2
Next X
Picture1.ForeColor = vbGreen
X = -10
Y = (Z2 - X * X2) / Y2
Picture1.CurrentX = X
Picture1.CurrentY = Y
For X = -10 To 10
Y = (Z2 - X * X2) / Y2
Picture1.Line -(X, Y)
Picture1.Circle (X, Y), 0.2
Next X
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture1.ToolTipText = "( " & Round(X, 1) & "," & Round(Y, 1) & " )"
End Sub
No comments:
Post a Comment
Note: only a member of this blog may post a comment.