Introduction to BASIC
Curves and Graphs
Before drawing curves or graphs, the coordinate system should be set.
sets the coordinate system where the range of x coordinate is from x1 to x2, and the range of y coordinate is from y1 to y2.
draws the axes of coordinate.
PLOT LINES statements draw segments continuously.
A sequential execution of
PLOT LINES: x,y;
draws an approximation of a curve.
10 DEF f(x)=x^3-x 20 SET WINDOW -4,4,-4,4 30 DRAW axes 40 FOR x=-4 TO 4 STEP 0.01 50 PLOT LINES: x,f(x); 60 NEXT x 70 END
Refer to PLOT LINES