\n Graph:
\n");
$mustnum = "[0-9]";
if ($aval != "" AND $bval != "" AND $cval != "" AND eregi($mustnum, $aval) AND eregi($mustnum, $bval) AND eregi($mustnum, $bval) AND $ymax > $ymin AND $xmax > $xmin AND eregi($mustnum, $xmax) AND eregi($mustnum, $xmin) AND eregi($mustnum, $ymax) AND eregi($mustnum, $ymin)AND eregi($mustnum, $incr)) {
$xArray = array();
for ($i = $xmin; $i <= $xmax; $i = $i + $incr) {
$xArray[$i] = (($i * $i) * $aval) + ($bval * $i) + $cval;
if ($xArray[$i] == 0) {$xint = $xArray[$i];}
if ($i == 0) {$yint = $xArray[$i];}
}
for ($e = $ymax; $e >= $ymin; $e = $e - $incr) {
for ($u = $xmin; $u <= $xmax; $u = $u + $incr) {
if ($xArray[$u] == $e) {print (" * ");
} elseif ($u == 0) {print ("|");
} elseif ($e == 0) {print (" _ ");
} else {print (" _ ");}
# print ("$xint : $yint");
}
print ("
\n");
}
# print ("Results graphed:
\n");
# if ($xint == "") {print ("No integer x-intercepts.
\n");}
# if ($xint) {print ("x-intercept = (0, $xint)
\n");}
# if ($yint == "") {print ("No integer y-intercepts.
\n");}
# if ($yint) {print ("y-intercept = ($xArray[0], 0)
\n");}
} else {print ("Please enter a numerical coefficient in each field. If a coefficient does not appear on the equation you're using, enter a 0.");}
?>