Såg att jag i hastigheten råkade skriva ^ i föregående inlägg för "upphöjt till" som man gör i t.ex. Matlab. Det funkar ju inte i php...
Här är ett enkelt litet test av min funktion.
Kod:
<?
function y($x, $x_left, $x_right, $amplitud) {
$t = 10 * ($x - $x_left)/($x_right - $x_left) - 5;
$y = $amplitud * exp(-$t * $t / 2);
return $y;
}
?>
<html>
<head>
<title>"Bell-kurva"</title>
</head>
<body>
<?
$x_left = 200;
$x_right = 600;
$amplitud = 180;
for ($x = $x_left; $x <= $x_right; $x++) {
$y = round(y($x, $x_left, $x_right, $amplitud));
echo "<div style=\"position: absolute; top: " . ($amplitud - $y) . "px; left: " . $x . "px; font-weight: bold;\"> . </div>\n";
}
?>
</body>
</html>
Är detta vad du sökte, Robert?