Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
1 4 3 2
???·x - 3·x + 2·x + 11·x - 6
2
0.5*pow($x,4) - 3*pow($x,3) + 2*pow($x,2) + 11*$x - 6
1
???????????????????????????????????
4 3 2
2·x - 3·x + 2·x + 11·x - 6
1 / ( 2*pow($x,4) - 3*pow($x,3) + 2*pow($x,2) + 11*$x - 6 )
<?
//Formel aus Textfeld:
$s="1/2x^4-3x^3+2x^2+11x-6";
$p=preg_replace("/(.*?)x\\^{0,1}(.*?)([+-]{1})/",
"\\1*pow(\$x,\\2)\\3",
$s);
$p=preg_replace('/pow\(\$x,\)/','$x',$p);
echo $s;
echo "<br>\n";
echo $p;
echo "<br>\n";
for ($x=0; $x<10;$x++) {
eval('$y='.$p.';');
echo "<br>\n";
echo 'x='.$x.'; y='.$y;
}
?>
<?
//Formel aus Textfeld:
$s="x^2+x+1";
//$s="1/2x^4-3x^3+2x^2+11x-6";
$p=preg_replace("/(.*?)x\\^{0,1}(.*?)([+-]{1})/",
"\\1*pow(\$x,\\2)\\3",
$s."+0");
$p=preg_replace('/pow\(\$x,\)/','$x',$p);
$p=preg_replace('/pow\(\$x,\)/','$x',$p);
$p=preg_replace('/\+\*pow/','+pow',$p);
$p=preg_replace('/\-\*pow/','-pow',$p);
$p=preg_replace('/\+\*\$x/','+$x',$p);
$p=preg_replace('/\-\*\$x/','-$x',$p);
$p=preg_replace('/^\*pow/','pow',$p);
$p=preg_replace('/^\*\$x/','$x',$p);
echo $s;
echo "<br>\n";
echo $p;
echo "<br>\n";
for ($x=0; $x<10;$x++) {
eval('$y='.$p.';');
echo "<br>\n";
echo 'x='.$x.'; y='.$y;
}
?>