The
processing speed
of
your
computer
also becomes a consider-
ation
when
using calculated shapes.
Depending
on
the particular
equation
and the
programming
used to calculate it, a shape even
only
an inch
or
so
square can require tens
of
thousands
of
calcula-
tions (each calculation does
not
necessarily fill an array location),
and several
minutes
or
even
hours
of
processing time before any
results are sent to the
printer
for plotting.
Moreover,
the
number
of
required calculations can increase geometrically
with
the size
of
the
shape.
Our
simple
demonstration
program,
for example, takes
several minutes to run. A
program
that plots a complex figure the
size
of
the page can easily take
hours
to run!
Even
if
you
don't
understand
all
of
the
programming
in it,
try
the
following
program
to
see
how
a graphics plotting
program
runs.
The
calculations in the
program
will take a few minutes, before
printing
starts. Lines 100-280 calculate the sine curve, and lines 320-
440
plot
the points.
10
r'em
20
rem
sine
curve
plotter
30
rem
------------------
40
esc$=ch,-$(27)
50
pi=3.14159265
60
rem
-------------------
70
rem
calculate
the-curve
80
rem
and
fill
the
array
90
rem
-------------------
100
dim
ptX(480,20)
110
dx
-
2*pi/240
120
for
k =
239
to
0
step
-I
130
yl
=
64*(sin(xl*10)/(xl*pi/2+1)+I)
140
yi
=
int(yl+.5)
150
row
=
int(yi/6)
160
bit
=
yi-row*6
170
ptX(k,row)
=
ptX(k,row)
Dr
2'(6-bit)
180
xl
=
:d+dx
1'70
next
k
200
xl
= dN
210
for
k =
240
to
479
step
1
220
yl
=
abs(64*(sin(xl*10)/(xl*pi/2+1)-1»
230
yi
=
int(yl+.5)
240
row
=
int(yi/6)
250
bit
=
yi-row*6
260
ptX(k,row)
=
ptX(k,row)
Dr
2
A
(6-bit)
270
xl
=
xl+dx
280
next
k
290
rem
--------------------
300
rem
print
the
sine
curve
310
rem
--------------------
320
open
1,4
330
print#I,esc$+"A"+chr$(6)
:
rem
set
line
spacing
to
6/72
inch
340
for
row
= 2
to
19
350
p$
=
""
:
1:1$
=
1111
360
print#1,esc$+"K
"
+chr$(224)+chr$(1>;
r'em
set
single
density
9l'o:\ldlll"
6-15