Input #1, X(I), y(I)
Next i
Close #1
Calc = 0
Call calcule(a, b, r, x(), y(), n, calc)
Call pnt(x(), y(), n, a, b, r, calc, x1, y1, x2, y2)
End Sub
Private Sub calcule(a, b, r, x, y, n, calc)
For i = 1 To n
If a1<x(i) and x(i)<a2 and b1<y(i) and y(i)<b2 Then calc = calc + 1
Next i
Print "calcule"
End Sub
Private Sub pnt(x, y, n, a, b, calc, x1, y1, x2, y2)
Form1.BackColor = RGB(100, 100, 100)
Form1.BackColor = vbBlue
Form1.CurrentX = 50
Form1.CurrentY = 50
Print "number of points: "; calc
Line (0, 3000)-(5000, 3000), vbRed
Line (2500, 0)-(2500, 5000), vbRed
Form1.CurrentX = 4900
Form1.CurrentY = 2700
Print "x"
Form1.CurrentX = 2600
Form1.CurrentY = 200
Print "y"
Line (a1, b1)-(a2,b2), , B
For i = 1 To n
Pset(x(i),y(i)), vbgreen
Next i
End Sub
Private Sub Command17_Click()
Dim a, b(100) as single
Open “C:\inf\input.txt” for input as #1
SUB calcule (a, b, x(), y(), n, calc)
SUB pnt (x(), y(), n, a, b, calc)
Input #1, a1,b1,a2,b2, k
For i=1 to n
Input #1, x1(i), y1(i), x2(i), y2(i), l(i)
Next i
Close #1
Calc = 0
Call calcule(a, b, r, x(), y(), n, calc)
Call pnt(x(), y(), n, a, b, r, calc, x1, y1, x2, y2)
End Sub
Private Sub calcule(a, b, r, x, y, n, calc)
For i = 1 To n
If a2-x1(i)<k+l(i) and b2-y1(i)<k+l(i) Then calc = calc + 1
Next i
Print "calcule"
End Sub
Private Sub pnt(x, y, n, a, b, calc, x1, y1, x2, y2)
Form1.BackColor = RGB(100, 100, 100)
Form1.BackColor = vbBlue
Form1.CurrentX = 50
Form1.CurrentY = 50
Print "number of points: "; calc
Line (0, 3000)-(5000, 3000), vbRed
Line (2500, 0)-(2500, 5000), vbRed
Form1.CurrentX = 4900
Form1.CurrentY = 2700
Print "x"
Form1.CurrentX = 2600
Form1.CurrentY = 200
Print "y"
Line (a1, b1)-(a2, b2), , B
For i = 1 To n
Line(x1, y1)-(x2,y2), vbgreen, B
Next i
End Sub
Private Sub Command18_Click()
Dim a, b(100) as single
Open “C:\inf\input.txt” for input as #1
SUB calcule (a, b, x(), y(), n, calc)
SUB pnt (x(), y(), n, a, b, calc)
Input #1, a, b
For i=1 to n
Input #1, x(i), y(i),r(i)
Next i
Close #1
Calc = 0
Call calcule(a, b, r, x(), y(), n, calc)
Call pnt(x(), y(), n, a, b, r, calc, x1, y1, x2, y2)
End Sub
Private Sub calcule(a, b, r, x, y, n, calc)
For i = 1 To n
If (x(i)-a)^2+(y(i)-b)^2<r(i)^2 Then calc = calc + 1
Next i
Print "calcule"
End Sub
Private Sub pnt(x, y, n, a, b, calc, x1, y1, x2, y2)
Form1.BackColor = RGB(100, 100, 100)
Form1.BackColor = vbBlue
Form1.CurrentX = 50
Form1.CurrentY = 50
Print "number of points: "; calc
Line (0, 3000)-(5000, 3000), vbRed
Line (2500, 0)-(2500, 5000), vbRed
Form1.CurrentX = 4900
Form1.CurrentY = 2700
Print "x"
Form1.CurrentX = 2600
Form1.CurrentY = 200
Print "y"
Line (x1, y1)-(x2, y2), , B
Pset(a,b)
For i = 1 To n
circle(x(i),y(i)),r(i), vbgreen
Next i
End Sub
Private Sub Command19_Click()
Dim a, b(100) as single
Open “C:\inf\input.txt” for input as #1
SUB calcule (a, b, x(), y(), n, calc)
SUB pnt (x(), y(), n, a, b, calc)
Input #1, a, b
For i=1 to n
Input #1, x(i), x1(i), y1(i), x2(i), y2(i)
Next i
Close #1
Calc = 0
Call calcule(a, b, r, x(), y(), n, calc)
Call pnt(x(), y(), n, a, b, r, calc, x1, y1, x2, y2)
End Sub
Private Sub calcule(a, b, r, x, y, n, calc)
For i = 1 To n
If x1(i)<a and a< x2(i) and y1(i)<b and b<y2(i) Then calc = calc + 1
Next i
Print "calcule"
End Sub
Private Sub pnt(x, y, n, a, b, calc, x1, y1, x2, y2)
Form1.BackColor = RGB(100, 100, 100)
Form1.BackColor = vbBlue
Form1.CurrentX = 50
Form1.CurrentY = 50
Print "number of points: "; calc
Line (0, 3000)-(5000, 3000), vbRed
Line (2500, 0)-(2500, 5000), vbRed
Form1.CurrentX = 4900
Form1.CurrentY = 2700
Print "x"
Form1.CurrentX = 2600
Form1.CurrentY = 200
Print "y"
Line (x1, y1)-(x2, y2), , B
Pset(a,b)
For i = 1 To n
line(x(i),y(i)),r(i), vbgreen
Next i
End Sub