2
$\begingroup$

I am trying to find a formal for calculating the internal volume of a cube.

for instance:

[][][][][]
[]{}{}{}[]
[]{}{}{}[]
[]{}{}{}[]
[][][][][]

with a height of $5m$, while each [] and {} represents $1m^3$ block.

with this example the internal cube ({}) is $27m^3$ (3*3*3).

I'm sure that's not a very good explanation, let me try another way. Imagine a cube at 5*5*5. Each block is $1m^3$. There must be a floor, ceiling, and walls. Given this requirement, this leaves the 3*3*3 inner cube.

Another example is a 3*3*3 leaving an interior of 1*1*1.

The question then is what's a formula that could calculate the inner volume given A by B by C?

This may not be a cube either could be a rectangle.

$\endgroup$
5
  • $\begingroup$ What about (a-2)(b-2)(c-2)? $\endgroup$
    – rbm
    Commented Apr 24, 2013 at 13:21
  • $\begingroup$ A block $A \times B \times C$ is a parallelepiped or brick, but not a cube unless $A=B=C$ $\endgroup$ Commented Apr 24, 2013 at 13:25
  • $\begingroup$ @RossMillikan of course, I had given a cube as two examples and had realized the possibility of other shapes. $\endgroup$
    – Eonasdan
    Commented Apr 24, 2013 at 13:29
  • $\begingroup$ I appreciate the amount of effort you put into explaining your problem clearly. Not everyone does this. Thanks! $\endgroup$
    – MJD
    Commented Apr 24, 2013 at 14:09
  • $\begingroup$ @MJD You're welcome. I spend a lot of time on SO so I try my best to write my own questions the way I expect others to write theirs. $\endgroup$
    – Eonasdan
    Commented Apr 24, 2013 at 14:41

2 Answers 2

3
$\begingroup$

In each dimension, the walls will subtract 1 from each side (top-bottom, left-right, etc) so the inner volume of $A\times B\times C$ is $(A-2) \times (B-2) \times (C-2)$

$\endgroup$
3
  • $\begingroup$ I thought of that but it seemed to simple. Given 6*7*4 the inner dimensions should be $40m^3$? Right? Guess this question was more of a sanity check :) $\endgroup$
    – Eonasdan
    Commented Apr 24, 2013 at 13:23
  • $\begingroup$ @Eonasdan: That is correct. $\endgroup$ Commented Apr 24, 2013 at 13:24
  • $\begingroup$ well I feel dumb now. Will accept in 5 minutes $\endgroup$
    – Eonasdan
    Commented Apr 24, 2013 at 13:26
0
$\begingroup$

This is the volume of a cube with a height of initial height-2.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .