this code asks you to set the verticle scale, the horizontal scale
it then says that it is in the form "y=ax^b+cx+d" and asks you to enter a, b, c, and d
it the draws the draph full screen at 1280x1024x16 with scaled axes, when you change c to other than 0 it does something wrong so until this is fixed please leave c as 0, everything else works as far as i know, please use the scales requested, some outside it may work but you may encounter problems.
if anyone has an explanation for the strange occurance when c is changed then please tell me. also i have problems if i have both of the scales above 1, if one scale is 1 and te other is within it's range it's fine but not if both are changed :s
edit:fixed a scale problem, still has problem with c and if both scales are changed
print "enter vertical scale (1-19)" : input vscaleprint "enter vertical scale (1-19)" : input vscale : print "enter horizontal scale (1-29)" : input hscale : cls
print "form is y=ax^b+cx+d" : print "enter a" : input a# : print "enter b" : input b
print "enter c" : input c# : print "enter d" : input d# : cls
set display mode 1280, 1024, 16 : for v=1 to 1024 : dot 640,v : next v
for h = 1 to 1280 : dot h, 512 : next h
for gx=1 to 1280 step 20 : for gx2=1 to 1024 : dot gx, gx2 : next gx2 : next gx
for gy=11 to 1024 step 20 : for gy2=1 to 1280 : dot gy2, gy : next gy2 : next gy
vscaleprint=vscale : if vscale<=1 then vscaleprint=0
if vscale>=20 then vscaleprint=19
for y=-480 to (500-(20*vscale)) step (20-vscaleprint) : set cursor 635, -((y*vscale)-512) : print y : next y
hscaleprint#=hscale : if hscale<=1 then hscaleprint#=0
if hscale>=15 then hscaleprint#=14.5
for hx =0 to (1000-(20*hscale)) step int(30-(2*hscaleprint#)) : set cursor ((hx*hscale)+640),512 : print "`",hx : next hx
for nhx =0 to (-(1000-(20*hscale))) step int(-(30-(2*hscaleprint#))) : set cursor ((nhx*hscale)+640),512 : print "`",nhx : next nhx
for x = 1 to 1280 step 1 : x#=x : x2#=((x#-640)/(hscale)) : y1#=((a#/2)*(x2#^b)) : y2#=(y1#+(x2#*c#)) : y3#=(y1#+y2#+d#) : y4#=(-((vscale*y3#)-512)) : dot x,y4# : next x
wait key
this now has a grid, read from the top of the numbers on the y axis and the left of the x axis
http://www.larinar.tk
AMD athlon thoroughbred 2200, 512Mb ram, 40Gb HD, ati saphire radeon 9600 atlantis w/128mb ddr ram, good creative-labs soundcard, cd-rw + dvd drives.