# How to calculate new box dimensions given a reduction in volume

I have a rectangular box with given dimensions $$l, w, h$$ with available volume $$v = lwh$$. If I can only pack up to 80% of $$v$$, how would I go about determining the new, smaller dimensions such that the new $$v = lwh$$ is 80% of original $$v$$ where the new dimensions should be reduced proportionally to retain the original box shape?

I'm trying to write some C# code to do some bin packing testing, but this algorithm doesn't consider a box volume threshold, it only packs according to dimensions. Thanks!

You already know that $$v = lwh$$, so you want to determine new dimensions for which $$v' = 0.8v$$. So you could reduce any one of the three dimensions, such as $$w' = 0.8w$$, to do that. If you want to shrink the box but keep the proportions, just distribute the factor:
$$v' = 0.8v = 0.8lwh = \sqrt[3]{0.8}l\sqrt[3]{0.8}w\sqrt[3]{0.8}h$$ $$l' = \sqrt[3]{0.8}l$$ $$w' = \sqrt[3]{0.8}w$$ $$h' = \sqrt[3]{0.8}h$$
In other words, just shrink each dimension by $$\sqrt[3]{80\%}$$ or multiply each dimension by $$\approx 0.9283$$.
Suppose the new length $$l'=kl$$, new width $$w'=kw$$ and new height $$h'=kh$$ where $$k$$ is the ratio of new dimensions to old dimensions. We have $$l'w'h'=k^3lwh=0.8lwh$$, thus $$k=0.8^{1/3}$$.