6/
From
Here to
Eternity
If you use
a
program
similar to the one in this section,
measuring the length of
a
line
is
easy with the X-PatL
Simply
position the Pen over the line's
startpoint and
press down, then
position the Pen over the
endpoint
and
press again.
The
distance
between these two points will be displayed
on the
Screen
in
3-significant-digit inches (e.g.,
3.14").
Your Color Computer
doesn't
display
the
last digit if it's a
{but don't be alarmed, the
X-Pad and Color
Computer
know it's still there!). For example, if length
is
7.20,
7.2
will
be displayed on the Screen.
To measure length:
1. Type (or load
from
cassette) and RUN the program.
2.
Press the
Pen
down
where you want to begin
measuring length
(startpoint)
and then press the Pen
down where you want
to stop
measuring
length
(endpoint).
The
length will be
immediately
displayed
on your Screen.
Length
Routine
5
CLS
:REM
LENGTH
10 PRINT
"GET FIRST
POINT"
20 GDSUB 150
30
IF
S<>3
THEN
20
40
PRINT"GET
SECOND
POINT"
50
Xl=XsYi=Y
60 GOSUB
150
70
IF S
=
3 THEN
G0
80
GOSUB 150: IF
SOS THEN 80
80
B=ABSiXl-X)
:C=ABS(Y1-Y)
85 REM
UALUE
OF EACH
INCREMENT
BOTH AXIS
100
L=S0R« <B#B)+(C*C>
)/28*4
U0 L=INT(L#100>/100
120
CLS:PRINT"LENGTH
IS"5L
130
GOSUB 150: IF
S=3 THEN 130
ON
19