04-27-2003, 09:17 AM
I was just curious tonight, and I made a graphing program.
The problem I'm having is setting customizable window settings.
Will you guys help me implement that? Here's the code.
The problem I'm having is setting customizable window settings.
Will you guys help me implement that? Here's the code.
Code:
DEFDBL A-Z
SCREEN 13
xhalf = 160
yhalf = 100
xfull = 320
yfull = 200
'not fully implemented, but meh
xmin = -10
xmax = 10
ymin = -10
ymax = 10
xrange = xmax - xmin
yrange = ymax - ymin
xchange = xmax / xhalf
LINE (xhalf - 1, 0)-(xhalf - 1, yfull - 1), 15
LINE (0, yhalf - 1)-(xfull - 1, yhalf - 1), 15
b = xmin
FOR x = 0 TO xfull-1
y = mx + b
newy = -(y / xchange) + yhalf
b = b + xchange
IF oldx THEN LINE (oldx, oldy)-(x, newy), 15 ELSE PSET (x, newy), 15
oldy = newy: oldx = x
NEXT