vance
vance

Reputation: 119

How can I calculate how many boxes fit inside a bigger box?

I have a defined small square or rectangle, for example 10x7cm and a bigger square or rectangle for example 35x46cm. What formula could I use to calculate the number boxes that fit in the bigger box?

edit, the simple way maybe

$arrDefault["impo_ancho"]   = floor($arrDefault["pliego_ancho"] / $arrDefault["job_ancho"]);
$arrDefault["impo_alto"]    = floor($arrDefault["pliego_alto"] / $arrDefault["job_alto"]);
$arrDefault["imposition"]   = $arrDefault["impo_ancho"] * $arrDefault["impo_alto"];

Upvotes: 0

Views: 4130

Answers (1)

OnceUponATime
OnceUponATime

Reputation: 488

If the formula does not need to be intergrated into a script, you might want to use one of the ready-made calculators available on the web,

e.g. this one:

https://www.engineeringtoolbox.com/smaller-rectangles-within-larger-rectangle-d_2111.html

Here you can specify the size of the larger box or rectangle as well as the size of the smaller ones.

Upvotes: 1

Related Questions