Star Micronics SB-15 Printer User Manual


 
at a time. The variable A$ is used to build a string of all the
columns of BIT% in a given row.
As you can see, by taking the program in small pieces and
analyzing it, graphics programming does not have to be difficult.
If you want to try some other plots, try these (replace lines after
600 with the lines below). The printouts from each program are
shown below the listing.
600
610 'Subroutine to plot a star.
620 '
630 RAD = 9
640 FOR ANG% = 0 TO 360 STEP 45
650 RANG = ANG% ;k 3.14159 / 180
660 RANG2 = (ANG% + 135) ;k 3.14159 / 180
670 Xl = RAD * COS(RANG) + 10
680 Yl = RAD * SIN(RANG) + 10
690 X2 = RAD ;';
COS(RANG2) + 10
700 Y2 = RAD 9~ SIN(RANG2) + lq
710 GOSUB 270
720 NEXT ANG%
730 RETURN
-
600
610 'Subroutine to plot a sine wave.
620
630 xl = 0 : Yl = 10 : x2 = 20
: Y2 = 10
640 GOSUB 270
650 Xl = 10 : Yl = 0 : X2 = 10
: Y2 = 20
660 GOSUB 270
670 Xl = 0 : Yl = 10
680 FOR X2 = 0 TO 24) STEP .2
690 Y2 = 10 - 9 * SIN(3.14159
s:
X2 / 10)
: GOSUB 270
700 NEXT X2
710 RETURN
114