0
$\begingroup$

This is my first post here and also i'm bad with math so don't be mad at me :)

Here is my issue, i have a box and i have another box inside, now i want that box inside to be at exactly same distance from each side, no matter what size it parent is.

Now i know how to calculate the distance from the sides, but i can't figure how to get right box dimensions. To make thing more clear i draw this example:

http://www.part.lt/img/f2204b0558a21a3695c6698de6e0f7f4835.png

I hope i make some sense here :)

  • 0
    Do you want to maximize the volume of the box inside such that the distance from either side between the boxes is same? This is a optimization problem and we can use tools from calculus to solve it. Maximize $A=(x-2d)(y-2d)$ where A is area of box inside and $x,y$ are length and width respectively. Although, I am not sure where this will lead to!2012-07-01

1 Answers 1

1

If your outer box is $x \times y$ and you want the inner one at distance $d$, the inner dimensions are $x-2d \times y-2d$ and the centers need to match. Is that what you are after?

  • 0
    @Linas: maybe I am not getting by what you mean by "exactly same distance" or by 90%. Let's say the outer box is 16x20. Do you want to say the spacing between the inner and outer box is (say) 2? If so, my original answer says the inner box is 12x16. If you want the inner box 90% in each dimension of the outer box, it would be 14.4x16, but then the spacings in the two directions are different. You can still center the smaller in the larger.2012-07-02