Cylinder Calculations

"); if($dia<=0) { $dia="0"; } echo("Enter Cylinder Diameter: "); echo("Centimeters..."); } else { echo(">Centimeters..."); } echo("Inches..."); } else { echo(">Inches..."); } echo("".$rdiaset."
"); } else { echo(">Feet
"); } echo(NL); if($lgt<=0) { $lgt="0"; } echo("Enter Cylinder Length or Height: "); echo("Centimeters..."); } else { echo(">Centimeters..."); } echo("Inches..."); } else { echo(">Inches..."); } echo("".$rlgtset."
"); } else { echo(">Feet
"); } echo(N2L); echo ("
"); if(!$dia or !$lgt) {} //If no numbers have been entered, don't do anything. elseif(!$rdiaset or !$rlgtset) { //If no units have been selected echo(" You must select units for each dimension."); }else { If($rdiaset=="Centimeters") { $dia=cm2inch($dia); } elseif($rdiaset=="Feet") { $dia=ft2inch($dia); } If($rlgtset=="Centimeters") { $lgt=cm2inch($lgt); } elseif($rlgtset=="Feet") { $lgt=ft2inch($lgt); } $area=areaof($dia); $volume=$area*$lgt; $cmvol=$volume*2.54*2.54*2.54; echo("The volume is ".number_format($cmvol,2)." cubic centimeters (cc)(ml).".NL); echo(" . . . . . . . . . . . . ".number_format($cmvol/1000,2)." liters.".NL); echo(" . . . . . . . . . . . . ".number_format($cmvol*1.057/1000,2)." quarts.".NL); echo(" . . . . . . . . . . . . ".number_format($volume,2)." cubic inches.".NL); echo(" . . . . . . . . . . . . ".number_format(($volume/1728),2)." cubic feet.".NL); $gal=cuin2gal($volume); echo(". . . . . . . . . . . . ".number_format($gal,2)." gallons.".NL); echo("
"); echo("This container would hold ".number_format($volume*.036111,2)." pounds of water.
".NL); } ?>
Calculations Index Circle Calc. Rectangular Calc. Home