Using DRAW with PLOT

Author(s): Dick Wagner
Publication: The Plotter
Pub Details: The Plotter v11 n2 (Volume 11, Issue 2)
Pages: 4

An interesting display of PLOT with DRAW can be made with the following program. As noted in the REM statements, certain numbers make it possible to overlap vertical lines in the boxes. To easily show this, delete the last part of line 130 (the Y coordinate) and change it to 50. RUN and see that the lines overlap.

It should be possible to tack on any DRAW figure to a curve like this. The Y coordinates in line 130 will need to be adjusted to keep the figure within screen boundaries or the program will stop.

  10 REM PLOT A SIN CURVE WITH A BOX
20 REM PRESS BREAK WHEN FINISHED TO DELETE MESSAGE "B INTEGER OUT OF RANGE 1000:1"
30 REM numbers .05 in LINE 130, 251 in LINE 140, and 12 in LINE 900 are important for overlapping vertical lines
120 PAPER 0: INK 7: BORDER 0
130 FOR x=0 TO 2*3.14159 STEP .05
135 IF x>6.1 THEN PRINT AT 21,0;"SIN FUNCTION WITH A BOX"
140 PLOT x/(2*3.14159)*251,SIN (x)*75+100
145 GO SUB 900
150 NEXT x
160 GO TO 160
900 LET A=12
1000 DRAW A,0
1010 DRAW 0,-22
1020 DRAW -A,0
1030 DRAW 0,22
2000 RETURN
SIN function with a box program output
SIN function with a box program output

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.