Center of Gravity Calculator

[insert_php]
//—————————————-
//cj location behind front wheels = rear wheel weights / overall weight x wheelbase
if($_POST[‘a’] == “lbfw”)
{
$lbfw_rear_wheel_weight = $_POST[‘lbfw_rear_wheel_weight’];
$lbfw_overall_weight = $_POST[‘lbfw_overall_weight’];
$lbfw_wheelbase = $_POST[‘lbfw_wheelbase’];
$lbfw_errors = 0;
if($_POST[‘lbfw_rear_wheel_weight’] == “”) {$lbfw_errors++;}
else { if(!is_numeric($_POST[‘lbfw_rear_wheel_weight’])) {$lbfw_errors++;} }

if($_POST[‘lbfw_overall_weight’] == “”) {$lbfw_errors++;}
else { if(!is_numeric($_POST[‘lbfw_overall_weight’])) {$lbfw_errors++;} }

if($_POST[‘lbfw_wheelbase’] == “”) {$lbfw_errors++;}
else { if(!is_numeric($_POST[‘lbfw_wheelbase’])) {$lbfw_errors++;} }

if($lbfw_errors != 0) {$lbfw_error_msg = “Please enter proper values!”;}
else
{
$total_lbfw = $_POST[‘lbfw_rear_wheel_weight’] / $_POST[‘lbfw_overall_weight’] * $_POST[‘lbfw_wheelbase’];
$view_total_lbfw = ”   Location Behind Front Wheels = “.$total_lbfw;
}
}
//—————————————-
//cg location off-center to heavy side = track / 2 – [ weight on light side / overall weight ] x track
if($_POST[‘a’] == “locohs”)
{
$locohs_weight_on_light_side = $_POST[‘locohs_weight_on_light_side’];
$locohs_overall_weight = $_POST[‘locohs_overall_weight’];
$locohs_track = $_POST[‘locohs_track’];
$locohs_errors = 0;
if($_POST[‘locohs_weight_on_light_side’] == “”) {$locohs_errors++;}
else { if(!is_numeric($_POST[‘locohs_weight_on_light_side’])) {$locohs_errors++;} }

if($_POST[‘locohs_overall_weight’] == “”) {$locohs_errors++;}
else { if(!is_numeric($_POST[‘locohs_overall_weight’])) {$locohs_errors++;} }

if($_POST[‘locohs_track’] == “”) {$locohs_errors++;}
else { if(!is_numeric($_POST[‘locohs_track’])) {$locohs_errors++;} }

if($locohs_errors != 0) {$locohs_error_msg = “Please enter proper values!”;}
else
{
$total_locohs = $_POST[‘locohs_track’] / 2 – ($_POST[‘locohs_weight_on_light_side’] / $_POST[‘locohs_overall_weight’]) * $_POST[‘locohs_track’];
$view_total_locohs = ”   Center of Gravity = “.$total_locohs;
}
}
//—————————————-
//cg height = [ level wheelbase x raised wheelbase x added weight on scale / distance raised ] x overall weight
//or maybe (level wheelbase x raised wheelbase x added weight on scale) / (distance raised x overall weight)
if($_POST[‘a’] == “hotcog”)
{
$hotcog_level_wheelbase = $_POST[‘hotcog_level_wheelbase’];
$hotcog_raised_wheelbase = $_POST[‘hotcog_raised_wheelbase’];
$hotcog_overall_weight = $_POST[‘hotcog_overall_weight’];
$hotcog_added_weight_on_scales = $_POST[‘hotcog_added_weight_on_scales’];
$hotcog_distance_raised = $_POST[‘hotcog_distance_raised’];
$hotcog_errors = 0;
if($_POST[‘hotcog_level_wheelbase’] == “”) {$hotcog_errors++;}
else { if(!is_numeric($_POST[‘hotcog_level_wheelbase’])) {$hotcog_errors++;} }
if($_POST[‘hotcog_raised_wheelbase’] == “”) {$hotcog_errors++;}
else { if(!is_numeric($_POST[‘hotcog_raised_wheelbase’])) {$hotcog_errors++;} }
if($_POST[‘hotcog_overall_weight’] == “”) {$hotcog_errors++;}
else { if(!is_numeric($_POST[‘hotcog_overall_weight’])) {$hotcog_errors++;} }
if($_POST[‘hotcog_added_weight_on_scales’] == “”) {$hotcog_errors++;}
else { if(!is_numeric($_POST[‘hotcog_added_weight_on_scales’])) {$hotcog_errors++;} }
if($_POST[‘hotcog_distance_raised’] == “”) {$hotcog_errors++;}
else { if(!is_numeric($_POST[‘hotcog_distance_raised’])) {$hotcog_errors++;} }
if($hotcog_errors != 0) {$hotcog_error_msg = “Please enter proper values!”;}
else
{
$total_hotcog = ($_POST[‘hotcog_level_wheelbase’] * $_POST[‘hotcog_raised_wheelbase’] * $_POST[‘hotcog_added_weight_on_scales’] / $_POST[‘hotcog_distance_raised’]) * $_POST[‘hotcog_overall_weight’];
$view_total_hotcog = ”   Height of the Center of Gravity = “.$total_hotcog;
}
}
//===============================================
$content = ‘



Location Behind Front Wheels
$lbfw_error_msg
Rear Wheel Weight:
Overall Weight:
Wheelbase:
$view_total_lbfw



Location Off-Center on Heavy Side
$locohs_error_msg
Weight on Light Side:
Overall Weight:
Track:
$view_total_locohs

 


Height of the Center of Gravity
$hotcog_error_msg
Level Wheelbase:
Raised Wheelbase:
Overall Weight:
Added Weight on Scales:
Distance Raised:
$view_total_hotcog

‘;

$content = addslashes($content);
$content = “\$result=\””.$content.”\”;”;
eval($content);
print stripslashes($result);
[/insert_php]

How to Guides

View All >
Top 10 WORST Excuses to NOT Buy a Ford Truck!
Slideshow: Ten worst excuses for not buying a Ford truck or SUV.
Read It
5 Reasons Why the Ford Bronco Is Experiencing a Sales Slump
Slideshow: For two straight quarters now.
Read It
Ford F-150 Lightning Is the Latest EV to Receive Price Cuts
Slideshow: Ford's bold move: Price cuts propel 2024 F-150 Lightning sales.
Read It

All times are GMT -5. The time now is 09:02 PM.