EasyManua.ls Logo

Radio Shack TRS-80 X-PAD GT-116 - Area Routine

Radio Shack TRS-80 X-PAD GT-116
65 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Area Routine
10 CLSuREM AREA
PROGRAM
20
A2=0:AT=0:GOSUB 200
30 IF
S<>3
THEN 20
40
K0=X:Y0=Y:Xi=X:Yl=Y
50
PRINT
"TRACING
11
60 GOSUB
200
70
IF
S<>3 THEN
110
80 AIM
(Y+Yl
)/2)*(Xl-X)
90
X1=X:Y1=Y
100.
AT
=
AT
+
A1
:G0T0 G0
110
X=X0:Y=Y0
120
AIM
(Y+Yl
)/2)*<Xl-X>
130
AT=INT(AT+A1
)
140
A2=INT(AT/2)
:
A2=
AB5
(
A2/373
84
)
150
A2=INT(A2*100)/100
160
CLS:PRINT
n
AREA IS
"
5A2
170 GOSUB
200
180
IF
S<>3 THEN
170
190 GOTO 10
200 X=PEEK(65376) :
Y=
PEEK
< 65377
)
:S=PEEK(65378)
: RETURN
RUN the
program. Draw
some
figures
on
your
paper and
then figure each area.
Greater
Metropolitan
Areas
Ready to
charge
right in? How
about
trying
these
examples:
To find the area of
a
square,
follow these
steps:
1. Draw
a
1"
square
(four sides equal)
with your pen
and
a
ruler on
the
paper
of
your
X-Pad.
2.
RUN
the
program,
trace
around
the square
with
the
Pen while
applying
pressure
(trace the
square
only
once!),
and
then
lift the
Pen from
the
paper.
You
might
want
to put
your
ruler next
to the
Pen so
the
lines are
straight
and
accurate.
3. If you traced very close to the
square's
sides, you
should
have an area
of about
1"
(i.e.,
1.27, 1.56,
etc.)
since
the area for
a square
is
length x width and both
the
length and
width of
this
square is
1":
1x1=1.
Note:
The
closer
you
trace to
the square's
sides,
the
closer
your
area
is to
1"
square.
To find
the
area of
a
circle,
follow these steps:
1. Draw
a
circle with a
1"
radius (same as a
2"
diameter).
2.
Trace around the circle with the
Pen
while
applying
slight pressure
to
the
tip, and
then
lift the Pen
from
the
paper.
3. Area
should
be
about
3.1"
since the
area of
a circle is
ttW
2
:
3.14159265
x
(1)
=
3.14 (rounded to
three
significant digits).
Chapter 7
Checkpoint
1.
(True/False) Area is
a
two-dimensional
measurement
within
a
joined set of
points.
2.
(True/False)
X-Pad can
figure the area
of
only
boxes.
3.
(True/False) When
you
find
the
area
with
X-Pad,
you
are
actually
finding the
surface area of
the
figure.
22