LOOKUP HRFORTH  ( HGR page 1 reserved )
NOT ?ABORT" Must run with HRFORTH."

SRC" MACHID.4TH"
MACHID MACHID.MEM AND MACHID.128K
<> ?ABORT" 128K required."
FORGET MACHID

SRC" PLASMA.4TH"
SRC" CONIO.4TH"
SRC" HGRLIB.4TH"
SRC" FPU.4TH"

: DRAWAXIS
  0 HGRMODE HGRDRAWBUF TILEDRAWBUF DROP
  1 HGRCOLOR
  0   96 279 96  HGRLINE
  139 0  139 191 HGRLINE
  140 0  140 191 HGRLINE
;

: PLOTDONE
  KEY DROP
  -1 HGRMODE DROP
;

FPEXT XSCALE
FPCONSTPI 139 >FPINT FP/ XSCALE FPEXT!

FPEXT YSCALE
-95 >FPINT YSCALE FPEXT!

DEFER FUNC

: PLOTFUNC
  3 HGRCOLOR
  279 0 DO
    I DUP 139 - >FPINT XSCALE FPEXT@ FP*
    FUNC
    YSCALE FPEXT@ FP* FPINT> 95 +
    OVER 1+ OVER HGRPLOT HGRPLOT
  LOOP
;

' FPSIN IS FUNC
DRAWAXIS PLOTFUNC PLOTDONE

' FPCOS IS FUNC
DRAWAXIS PLOTFUNC PLOTDONE
