[4.2] Use DispG to force update to „
„„
„x and „
„„
„y
„x and „y are system variables that represent the distance between the centers of two pixels in the
graph view window. These variables are a calculated from the system variables xmin, xmax, ymin, and
ymax. However the values for „x and „y are not automatically updated when xmin, etc., are changed.
This is usually not a problem unless you use „x and „y in calculations in a program. You can force „x
and „y to be updated by executing the DispG instruction. This effect is shown by this test program:
test()
Prgm
clrio
0→xmin:50→xmax
0→ymin:50→ymax
disp "1. „x="&string(„x)
disp " „y="&string(„y)
dispg
disp "2. „x="&string(„x)
disp " „y="&string(„y)
10→xmin:200→xmax
10→ymin:200→ymax
disp "3. „x="&string(„x)
disp " „y="&string(„y)
dispg
disp "4. „x="&string(„x)
disp " „y="&string(„y)
EndPrgm
This program displays „x and „y, both with and without the DispG instruction. For the case labeled 1,
the values shown are whatever they happened to be before test() was run; the assignment of 0 and 50
to the min & max variables has no effect. For the case labelled 2, the correct values are shown
because DispG was executed. The min & max values are changed between cases 2 and 3, but the
displayed values don't change, because DispG isn't used. The final display case 4 shows that „x and
„y are finally updated, since DispG is again used.
So, if you want to use „x and „y in calculations in your program, execute DispG before you use them,
but after values are assigned to xmin, xmax, ymin and ymax.
[4.3] Truth plots
A truth plot is a graphic plot of a function such that a display pixel is turned on when the function is true,
and turned off when the function is false. This type of plot is built in to the HP48/49 series, but not the
TI89/92+.
This is Andrew Cacovean's version of a program to make a truth plot for an expression:
truth(exp1)
Prgm
4 - 2