# HP-200LX, HPCALC, Solver, Plot Error/Fix

#### Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

The HP-200LX HPCALC Solver application has off-by-1 errors in its
plotting algorithm.  For example, set up a plot area with XMIN=0,
XMAX=1, YMIN=0, YMAX=1.  The coordinate cross goes from (0, 0.00602) to
(0.99821, 1).  The lines following the dashed line can be saved in file
PLOTERR.EQN and loaded into the Solver application to both demonstrate
and work around the firmware bug.
-------------------------------------------------------------
{200LX Plot Err|! plotting bugs/details ! y = 82.5+82.5*sin(x)
!
There is an off-by-1 pixel error in both x and y plot range.

XMIN XMAX YMIN YMAX notes
==== ==== ==== ==== =========================================
0  560   -1  165  (0,0) to (559,165) pixel indexing.
Try y = x, a pixel-diagonal line.
Try y = 82.5+82.5*sin(x), x in degrees.
0  560/  -1/  1   (0,0) to (1,1), Try y = x^c.
559   165
-1  1+2/ -1-2/ 1   (-1,-1) to (1,1), y=x^3 is a good demo.
559   165

Pixel H/W = 36/166 (mm/pix) / 103/560 = 1.179.
Left/bottom graph borders are each 2 pix wide.
Cursor moves *inside* the borders, 560W x 166H.
Minimum RES is 4. (Less gets re-set to 4.)
Left/right keys move 20 pixels. Shifted, move 1.
Up/down keys move 15 pixels. Shifted, move 1.
RES = # of line segments (RES+1 points plotted).
!
}
{200LX Plot Fix|! Desired plot limits to required buggy limits !
0*(XLO+XHI+YLO+YHI+XMIN+XMAX+YMIN+YMAX)+

XMIN = XLO

+0*(  L(XMAX,(560*XHI-XLO)/559)
+ L(YMIN,(166*YLO-YHI)/165)
+ L(YMAX,YHI))
}