<?
$xg = array( 1 => 0,
2 => 3200000000,
3 => 5440000000,
4 => 5888000000,
5 => 6368000000,
6 => 6399700000,
7 => 6399999400,
8 => 6400000000) ;
$yg = array( 1 => 0,
2 => 1200,
3 => 10000,
4 => 18000,
5 => 45000,
6 => 1000000,
7 => 50000000,
8 => 4000000000 );
// richtigen x-Bereich suchen
$i = 1;
while($i<=8)
{
if($gehalt < $yg[$i])
{
$index = $i;
$i=8;
}
$i++;
}
// reverse Steigung: Delta y geteilt durch Delta x
$t1 = ($xg[$index] - $xg[$index - 1]) / ($yg[$index] - $yg[$index - 1]) ;
$x0 = $xg[$index - 1] + (($gehalt - $yg[$index - 1]) * $t1) ;
$weniger = round($x0);
$dummywidth = round($weniger / 6400000000 * 398) + 60 ;
?>
|