Kods:
Private Sub Command1_Click()
Picture1.Scale (-15, 15)-(15, -15)
Picture1.DrawWidth = 2
Picture1.Line (-14, 0)-(14, 0)
Picture1.Line (0, -14)-(0, 14)
Picture1.DrawWidth = 4
For x = -14 To 14 Step 2
Picture1.PSet (x, 0), vbRed
Picture1.Print x
Next x
For t = -14 To 14 Step 2
Picture1.PSet (0, t), vbRed
Picture1.Print t
Next t
Picture1.DrawWidth = 3
For i = -20 To 20 Step 0.01
k1! = Text1.Text: b1! = Text2.Text: k2! = Text3.Text: b2! = Text4.Text
j! = k1 * i + b1
Picture1.PSet (i, j), vbBlue
Next i
For n = -20 To 20 Step 0.01
m! = k2 * n + b2
Picture1.PSet (n, m), vbBlue
Next n
z! = 180 / 3.1416 * Atn((k2 - k1) / (1 + k1 * k2))
z = Int(100 * z) / 100
x0! = (b1 - b2) / (k2 - k1)
y0! = (k2 * b1 - k1 * b2) / (k2 - k1)
x0 = Int(100 * x0) / 100
y0 = Int(100 * y0) / 100
Text5.Text = z: Text6.Text = x0: Text7.Text = y0
End Sub
Private Sub Command2_Click()
Picture1.Cls
Text1.Text = "": Text2.Text = "": Text3.Text = ""
Text4.Text = "": Text5.Text = "": Text6.Text = ""
Text7.Text = ""
End Sub
Attālums starp punktu un taisni
Uzd.5.
Dots plaknē punkts x0,y0 un taisne, kas iet caur punktiem x1,y1 un x2,y2. Atrast attālumu starp punktu un taisni.
…