Star Micronics SG-10 User Manual page 122

Star micronics printer user's manual
Table of Contents

Advertisement

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.
610 'Subroutine to plot a star.
620
'
630
RAD = 9
640 FOR ANG% = 0 TO 360 STEP 45
650
RANG = ANG% * 3.14159 / 180
660
RANG:! = (ANG% + 135) * 3.14159 / 180
670
Xl = RAD J( COS(RANG) + 10
680 Yl = RAD Jc SIN(RANG) + 10
690
X2
= RAD * COS(RANG2) + 10
700
Y2 = RAD * SIN(RANG2) + l@
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 20 STEP .2
690
Y2
= 10 - 9 ;k SIN(3.14159 * X2 / 10) : GOSUB 270
700
NEXT X2
710 RETURN
114

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sg-15

Table of Contents