# Maths wizzes: volume question...

**URL:** <https://boards.straightdope.com/t/maths-wizzes-volume-question/487267>\
**Category:** Factual Questions\
**Created:** [February 24, 2009, 8:44pm UTC](https://boards.straightdope.com/t/maths-wizzes-volume-question/487267 "2009-02-24T20:44:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greenback](https://avatars.discourse-cdn.com/v4/letter/g/2bfe46/32.png) [@Greenback](https://boards.straightdope.com/u/Greenback)\
**Post date:** [February 24, 2009, 8:44pm UTC](https://boards.straightdope.com/t/maths-wizzes-volume-question/487267/1 "2009-02-24T20:44:02Z")

</div>

This should be simple, at least when I talk it out, but I can’t concoct a formula that works. Please help.  
The situation boils down to getting the volume of a container. The contain is a cylinder with three distinct sections: a cone, a tube, and a roof.

```auto

 
       /\
      / \
     | |
     | |
     | |
     | |
     | |
      \ /
       \/

```

I can get the volume of an empty container but I need to calculate the volume of product when the bin is partially filled.

I have dimensions as follows:  
cone height: ch  
cylinder height: h  
cylinder area: a  
roof height: rh

Assumptions:

- product in bin is level
- product fills bin to point of measurement
- slopes of cone and roof are 45 degrees so volume can be calculated using 1/3  
so volume of a bin = (h \* a) + ((1/3) \* ch \* a) + ((1/3) \* rh \* a)  
The only measurement (x) I have is one taken from the top of the roof, measuring straight down to the product in the bin.

How can I calculate the volume of the product?

I get hung up when x \> h or x \< rh.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [February 24, 2009, 9:02pm UTC](https://boards.straightdope.com/t/maths-wizzes-volume-question/487267/2 "2009-02-24T21:02:42Z")

</div>

You can’t set up a single smooth formula for this. Basically, you need three separate formulae for the three different cases. If x \< rh, then you’ve got all of the bottom cone filled, and all of the cylinder, so you’re starting off with 1/3 ch_a + h_a. In addition to that, you’ve got part of the roof filled, too: The total volume of the roof is 1/3 rh_a, and the part of it currently empty is equal to 1/3 pi_x^2 \* x, or converting that, 1/3 a x^3/rh^2. So the total volume filled is equal to a\*(1/3 ch + h + 1/3 rh - 1/3 x^3/rh^2) – That’s all of the bottom plus all of the cylinder plus all of the top minus the empty part of the top.

---

<div class="post-metadata">

**Author:** ![Greenback](https://avatars.discourse-cdn.com/v4/letter/g/2bfe46/32.png) [@Greenback](https://boards.straightdope.com/u/Greenback)\
**Post date:** [February 24, 2009, 9:18pm UTC](https://boards.straightdope.com/t/maths-wizzes-volume-question/487267/3 "2009-02-24T21:18:04Z")

</div>

Thanks. I was hoping to do this without if statements.

I guess I could go take a cutting torch and modify all the bins…
