100 ' *** SQ-2000 Plotter Program: 5-Point Star ***

110 '

120

' Initialize

 

 

 

130 '

 

 

 

140

DIM BUFFER%(360,45)

 

 

150 FOR BIT = 0 TO 7 : DOT%(7 - BIT) = 2 A BIT : NEXT

160

X.SCALE =

20

: Y.SCALE = 20

170 X.FACTOR = 360 / X.SCALE

: Y.FACTOR = 360 /

Y.SCALE

 

: LF$ = CHR$(lO)

180

ESC$ = CHR$(27)

190

'

 

 

 

200

' Plot curve

 

 

210

'

 

 

 

220 RADIUS1 = 10

: RADIUS2

= 2

230

Xl = 20

: Yl = 10

 

 

240 DIFF = (RADIUS1 - RADIUS2)

 

250

FOR ANGLE = 0 TO 6.3 STEP .15

260X2 = DIFF * COS(ANGLE) + RADIUS2 * COS(DIFF / RADIUS2 * ANGLE) + 10

270Y2 = DIFF X SIN(ANGL) - RADIUS2 * SIN(DIFF / R ADIUS2 * ANGL) + 10

280'

290' Draw a line from X1, Y1 to X2, Y2

300'

310 X.LENGTH = X2 - X1

: Y.LENGTH = Y2 -

Y1

320 X.STEPS = ABS(X.LENGTH * X.FACTOR)

 

 

330 Y.STEPS = ABS(Y.LENGTH * Y.FACTOR)

 

 

340 IF X.STEPS > Y.STEPS THEN STEPS = X.STEPS ELSE

STEPS = Y.STEPS

 

 

 

350 IF STEPS = 0 THEN 480

 

 

 

360 DELTA.X = X.LENGTH / STEPS

: DELTA-Y

= Y.

LENGTH / STEPS

 

 

 

370 FOR COUNT = 0 TO STEPS

 

 

380 X1 = X1 + DELTA.X

* Y1 = Y1 + DELTA.Y

 

390 '

 

 

 

400 ' plot a point at Xl, Y1

 

 

 

410 '

 

 

 

420 X.POINT = X1 * X.FACTOR

: Y.POINT

= Y1

* Y.FACTOR

 

 

 

430COLUMN = INT(X.POINT)

440ROW = INT(Y.POINT / 8)

450BIT = INT(Y.POINT - ROW * 8)

79