update
function xstroke() { return thestroke; }
function update () {
f=document.getElementById('fv').value;
p = []
with (Math)
for (var x = -a; x < a+.1; x += .1)
// p[p.length] = [x, x-x*x*x]
p[p.length] = [x, eval(f)]
stroke = xstroke()
//path(p,"func")
//stroke = "blue"
plot(f,-a,a)
setText(f,"fval")
setText(a.toFixed(2),"aval")
setText((-a).toFixed(2),"maval")
}
</script>
<!--@ interaction(s) -->
<br>
<h6>
y=<span id="fval">f</span>
<input type="text" id="fv" name="fname" value="x" onblur="toggle()" />
for <span id="maval">a <=x<= a</span>
<input type="button" value="-" onclick="a-=.25;update()"/>
<input type="button" value="+" onclick="a+=.25;update()"/>
</h6>
