660 RANG=ANG%*6 28/360
670 X2=RAD"COS(iANG)tlO : Y2=RADSSIN(RANG)tlO
680 GOSUB 250
690 NEXT ANG%
700 RETURN
If you are using with the IBM mode (DIP switch 1-6 off),
change the following lines to the program given above.
140 LPRINT CHR$(27>;"A";CHR$(6);CHR$(27);"2"
230 LPRINT CHR$(27);"A";CHR$(l2);CHR$(27);"2'+
n How the program works
In the program above, we’ve created an array called BIT%,
which is dimensioned in line 40. You’ll note that instead of using
numeric constants to dimension the array, we used the variables
<MAXCOL% and MAXROW%. This way, if your computer has
enough memory and you want to plot a larger image, all you
need to change are the values in line 30. The array MASK% con-
tains the values of the dots. (In order to make this program run
on most computers, we’re only six pins for graphics. With many
computers, you can use all eight available pins.) In lines 80 and
90 we’ve defined some other variables you’ll be interested in:
LX, LXFAC, LY, and LYFAC are used as scaling factors. By
changing these values, you can change the size of your printed
image or even distort it (you can, for example, make our circle
print as an ellipse). Experiment a little bit!
The main calculations for plotting the image are done in the
subroutine starting at program line 600. This is where you put
the formulas that you want to plot. By changing just the lines
after 600 (with some creative mathematics!) you can plot any
function - limited only by your imagination. Some examples
are shown at the end of this section.
What the program section starting at line 600 actually does is