$width0 = $_REQUEST['width0']; if ($width0 < 100) $width0=245; $height0 = $_REQUEST['height0']; if ($height0 < 40) $height0=70; $wheel0 = $_REQUEST['wheel0']; if ($wheel0 < 10) $wheel0=16; $stk_width = $width0 / 25.4; $stk_wall = (($height0 / 100) * $stk_width); $stk_height = (2 * $stk_wall) + $wheel0; $stk_circum = $stk_height * pi(); $stk_wrad = $wheel0 / 2; $stk_trad = $stk_height / 2; $width1 = $_REQUEST['width1']; if ($width1 < 100) $width1=265; $height1 = $_REQUEST['height1']; if ($height1 < 40) $height1=75; $wheel1 = $_REQUEST['wheel1']; if ($wheel1 < 10) $wheel1=16; $new_width = $width1 / 25.4; $new_wall = (($height1 / 100) * $new_width); $new_height = (2 * $new_wall) + $wheel1; $new_cirum = $new_height * pi(); $diff = (($new_cirum / $stk_circum) * 100) - 100; $new_wrad = $wheel1 / 2; $new_trad = $new_height / 2; $tire_mult = 4; $tire_max = max($stk_height, $new_height); $stk_tire = intval($stk_wall * $tire_mult); $stk_rim = ($wheel0 * $tire_mult) - 2; $stk_dec = $stk_rim / 8; $new_tire = intval($new_wall * $tire_mult); $new_rim = ($wheel1 * $tire_mult) - 2; $new_dec = $new_rim / 8; function between($num, $low, $high) { if($num < $low) return false; if($num > $high) return false; return true; } function checkRange($mph, $rpm) { // 035 038 032 $bs = $mph * 31.22; $pm = $bs * 0.073; if (between($rpm, $bs-$pm, $bs+$pm)) return "class='grn'"; $bs = $mph * 27.44; $pm = $bs * 0.084; if (between($rpm, $bs-$pm, $bs+$pm)) return "class='yel'"; $bs = $mph * 35.00; $pm = $bs * 0.066; if (between($rpm, $bs-$pm, $bs+$pm)) return "class='blu'"; } ?>