|
PROGRAM7620.BAS |
|
{* График функции *}REM basic ' Построение графика функции F (x) = x * xFunction F (x)
F = x * x
End Function
{ГРАФИК ФУНКЦИИ
}SCREEN 12
{Строим оси
}For I = 0 To 3
LOCATE 16, 38 + 10 * I: PRINT 4 * I
Next
For I = 0 To 3
s$ = "-" + STR$(4 * I)
LOCATE 16, 38 - 10 * I: PRINT s$
Next
For I = 0 To 4
LOCATE 16 - 3 * I, 38: PRINT 5 * I
Next
For I = 0 To 3
s$ = "-" + STR$(5 * I)
LOCATE 16 + 3 * I, 37: PRINT s$
Next
LINE (10, 240)-(630, 240)
LINE (320, 10)-(320, 470)
COLOR 3
LOCATE 1, 38: PRINT "Y"
LOCATE 17, 77: PRINT "X"
{Строим график функции
}COLOR 2
PSET (20*(-10) + 320, 240 - 10 * F(-10))
For x = -10 To 10 Step .1
XX = 20 * x + 320
YY = 240 - 10 * F(x)
LINE -(XX, YY)
Next
End
|