Hi, I should have looked in the forums first to find this answer, would have saved me some work. I'm using lookout, and needed to find gallons in a horizontal tank, I came up with the following formula...Then I decided to come to the forums to post the example, and I found this thread already started.
(LenghFeet*(((DiaFeet/2)^2*(acos(((DiaFeet/2)-(LevelInches/12))/(DiaFeet/2))))-(sqrt(2*((DiaFeet/2)*(LevelInches/12))-(LevelInches/12)^2)*((DiaFeet/2)-(LevelInches/12)))))*7.48
Where in my example lookout file:
LenghFeet=Pot used to enter the length of the tank in Feet (would be hard coded in production program)
DiaFeet=Pot used to enter the diameter of the tank in Feet (would be hard coded in production program)
LevelInches=Pot used to enter the height of the liquid in the tank in Inches (would be from the field instrument measuring this in inches)
7.48=gallons in a cubic foot
The attached example is the source (.lks) file, so you will need to change the extension from .txt to .lks and then compile it.
I hope this example is useful.
Rich Anderson
Green Bay, WI