一种函数的计算方法并给出相应的曲线图片(转贴)
<SCRIPT LANGUAGE="JavaScript"><!-- Begin
var a, b, c;
function xtop(form) {
form.u.value = (form.b.value * -1) / (form.a.value * 2);
}
function ytop(form) {
form.u2.value = -1 * (form.b.value * form.b.value) / (4 * form.a.value) - (-1 * form.c.value);
}
function doCoord(form) {
form.co.value = form.u.value + "," + form.u2.value;
}
function disc(form) {
form.o.value = (form.b.value * form.b.value) - (form.a.value * form.c.value * 4);
}
function zeroes1(form) {
form.n.value = ((form.b.value * -1) - (Math.sqrt(form.o.value))) / (form.a.value * 2);
}
function zeroes2(form) {
form.n2.value = ((form.b.value * -1) - (-1 * Math.sqrt(form.o.value))) / (form.a.value * 2);
}
function move_in(img_name,img_src) {
document[img_name].src=img_src;
}
// End -->
</script>
<form>
<table bgcolor="#C0C0C0" cellspacing=2 cellpadding=2 border=3>
<tr>
<td>
<b>
<h3>Parabolic Calculator</h3>
<input name="a" size="3">X<sup>2</sup>+
<input name="b" size="3">X +
<input name="c" size="3">
<br>
<input type="button" value="x-top" name="x-top" onclick="xtop(this.form)">
<input type="button" value="y-top" name="y-top" onclick="ytop(this.form)">
<input type="button" value="crd" name="crd" onclick="doCoord(this.form)">
<input type="button" value="disc." name="D" onclick="disc(this.form)">
<br>
<input type="button" value="0-points" name="zeroes" onclick="zeroes1(this.form);zeroes2(this.form)">
补充:asp教程,技巧与性能优化