function graph(fct,xMin,xMax){
dotCode = '
\n';
xCode = ' | '+
'
\n';
yCode = ' '+
' |
\n';
backCode = '\n';
if (navigator.appName == 'Netscape'){
leftCode = 'document.obj_id.left = ';
topCode = 'document.obj_id.top = ';
} else {
leftCode = 'document.all.obj_id.style.left = ';
topCode = 'document.all.obj_id.style.top = ';
}
nbXs =200;
nbYs = 200;
maxYpos = 225;
minXpos = 25;
var x = xMin;
yZero = Math.abs(eval(fct));
yMax = yZero;
yMin = yZero;
yMin = yZero;
datas = new Array();
deltaX = (xMax - xMin) / nbXs;
i = 0;
while (x <= xMax){
var y = eval(fct);
datas[i] = x + ':' + y;
yMax = Math.max(y, yMax);
yMin = Math.min(y, yMin);
yZero = Math.min(yZero, Math.abs(y))
x+= deltaX;
i++;
}
deltaY = nbYs / (yMax - yMin);
yPos = new Array();
for (i=0; i