// ------------------------------------------------------- // xplot.h // global xplot for *fun // ------------------------------------------------------- // uses gwin and fun // ----------------------- void xplot(gwin w, fun *fu) { double xa = w.getscale(1); double xb = w.getscale(2); int nn = w.getscan(); if (nn <= 0) nn = 100; double x,dx,y; dx = (xb - xa)/nn; x = xa; y = fu->f(x); w.move(x,y); for (int j = 1; j <= nn; j++) { x = xa + dx*j; y = fu->f(x); w.line(x,y); } } // --------------------------------------------------------