Chapter
10
I
BASIC Ke.ywords
WINDOW
Statement
Lets you change the physical coordinates of the screen
(or
cur-
rent viewport) by defining “world coordinates.” World coordinates
can be any single-precision floating point numbers, including
numbers outside the physical range
of
the screen as defined by
the VIEW statement.
Note:
The viewport
is
set
to
the entire screen by de-
fault.
For
more information on viewports, see the
VIEW command.
(x1,yl)
specifies the world coordinates for the upper-left corner of
the screen.
x
is
the horizontal coordinate, and
y
is the vertical
coordinate.
(~2~2)
specifies the world coordinates for the lower-left corner of
the display.
x
is the horizontal coordinate, and
y
is the vertical
coordinate.
The SCREEN option tells BASIC
to
set the coordinates like the
screen display where the lesser y-coordinate is in the upper-left
corner of the screen. If you omit screen, BASIC inverts the
y-coordinates
to
show
a
true Cartesian coordinate system. That
is, the lesser y-coordinate is in the lower-left corner of the
screen.
WINDOW lets you plot points outside the normal screen coordi-
nate limits by setting new world coordinates
to
the screen. WIN-
DOW transforms the new world coordinates onto the screen,
usually altering the aspect ratio.
Note:
CIRCLE, GET, and PUT do not use world
coordinates.
You can easily plot graphs by specifying coordinates that are di-
rectly proportional
to
the limits of the graph.
For
example,
to
plot
the increase of sales from
1984
to
1987
with sales averaging
100,000
to
300,000,
you can use the following command:
WINDOW
<1984,100000)-<1987,300000)
345