Placing smaller squares into one bigger square

Mihael007

New member
Joined
Aug 26, 2020
Messages
5
Hello I new to this forum.
I have a problem in my application and this problem is geometry based I think. What Im trying to do is to place "n" number of smaller squares into one biger square( we can call it canvas). The smaller sqaures are all the same width and height. i want to know distance between every one of that square in another words I want to place those squares in same distance far away one from another. I want to know how to calculate these two distances in the image?. Im telling once again that number of squares can be diferrent so it has many cases and every smaller square would be the same also i have biger sqaure dimensions. If you want to know about my application and how im placing sqaures into canvas is trought coordinates top left cornes of smaller squares would be starting point and every other square would have coordinate dependable from the width( which I dont know to calculate).
Ty for your response.
 

Attachments

  • Screenshot_1.png
    Screenshot_1.png
    14.9 KB · Views: 1
Hello I new to this forum.
I have a problem in my application and this problem is geometry based I think. What Im trying to do is to place "n" number of smaller squares into one biger square( we can call it canvas). The smaller sqaures are all the same width and height. i want to know distance between every one of that square in another words I want to place those squares in same distance far away one from another. I want to know how to calculate these two distances in the image?. Im telling once again that number of squares can be diferrent so it has many cases and every smaller square would be the same also i have biger sqaure dimensions. If you want to know about my application and how im placing sqaures into canvas is trought coordinates top left cornes of smaller squares would be starting point and every other square would have coordinate dependable from the width( which I dont know to calculate).
Ty for your response.
What are the dimensions of the big rectangle?

What are the dimensions of the small squares?

Please show us what you have tried and exactly where you are stuck.

Please follow the rules of posting in this forum, as enunciated at:


Please share your work/thoughts about this problem.
 
What are the dimensions of the big rectangle?

What are the dimensions of the small squares?

Please show us what you have tried and exactly where you are stuck.

Please follow the rules of posting in this forum, as enunciated at:


Please share your work/thoughts about this problem.

I mean it is all stored into variables. Dimension are dependable of the input but I have everything stored and ready to use. That isnt a problem. Problem is how to calculate that width in big rectangle so I can place smaller squares equaly apart. Once project is loaded i get all the information that means number of smaller squares with their dimension(all are the same dimensions ) and dimensions for bigger rectangle. My thought is once I know every of that how do I place those smaller squares into a big one what would be the best solution?
 
I mean it is all stored into variables. Dimension are dependable of the input but I have everything stored and ready to use. That isnt a problem. Problem is how to calculate that width in big rectangle so I can place smaller squares equaly apart. Once project is loaded i get all the information that means number of smaller squares with their dimension(all are the same dimensions ) and dimensions for bigger rectangle. My thought is once I know every of that how do I place those smaller squares into a big one what would be the best solution?
How would you solve this problem if you had "physically" bunch of little squares and a big rectangle,
 
I dont know, thats why Im asking?
In order to start thinking about it (and so we can discuss it more helpfully), please pick some specific numbers and show us some thinking about it. Even a bad attempt will communicate a lot to us, and may also help you better understand the requirements of the problem.

In particular, I'd want to see what data you would be given. Are you given the size of each small square, and the dimensions of the larger "square" (which apparently can be a rectangle), and the number of small squares? Do you have to figure out how to arrange them to fill the large one (in which case not all numbers will work)? Or will the arrangement always look like your image (with a known number in each direction)? Do you need the same spacing between squares, and between a square and the edge of the big square? Does it have to be the same in both directions? Most important, what does "best" mean?
 
In order to start thinking about it (and so we can discuss it more helpfully), please pick some specific numbers and show us some thinking about it. Even a bad attempt will communicate a lot to us, and may also help you better understand the requirements of the problem.

In particular, I'd want to see what data you would be given. Are you given the size of each small square, and the dimensions of the larger "square" (which apparently can be a rectangle), and the number of small squares? Do you have to figure out how to arrange them to fill the large one (in which case not all numbers will work)? Or will the arrangement always look like your image (with a known number in each direction)? Do you need the same spacing between squares, and between a square and the edge of the big square? Does it have to be the same in both directions? Most important, what does "best" mean?
Ok If you want it to put like that I can give you an example.
Lets call a bigger rectangle "Canvas". Smaller rectangles all have the same dimensions. Kepping that in mind here are test inputs for one case:
(I know I said that there where squares but i mispronounced , I thought that it is the same thing like rectangles. I was wrong).
Canvas height:843
Canvas width: 1320
Rectangle height:77
Rectangle width:182
Number of rectangles:17

So in this case I need to place smaller rectangles into canvas and I want to place them eaqualy apart in each direction. So my canvas would be best used ( If you have any other ideas im all ears).
My thinking is to arange those 17 rectangles in a way that space between them would be the same. I know it is not possible in every case so Im looking for better idea maybe if someone has.
For "Best" I meant what solution would be maybe better to doing this.
If you all want to know on what Im working on it is a Conceptual DataBase Modeler. So those rectangles are actually tables, but i divided them to be the same dimensions(just for this purpose) and canvas would be my drawing surface.
 
Let's look at one row. Suppose the length of the canvas is L and the length of each rectangle is x.

Now you will have space-rectangle-space-rectangle-...-rectangle-space.

Now how many rectangles you can put really depends on how much space you want between the rectangle. If the space is going to be big, then maybe you can fit only one (or even none!) rectangle in a row.

If you think about it, you will realize that there will be one more space than rectangles. Let the space be s. Let n be how many rectangles you can put in a row. So in total you will have nx + (n+1)s = total length of the canvas (which you can cut??)

nx + (n+1)s = nx + ns + s = n(x+s) + s = L (total length). Then n = (L-s)/(x+s). If this is an integer (1, 2, 3, etc, NOT 2.5 or 3 3/4) then this fine. If it is not an integer you can cut the canvas OR you can change s so that you do get an integer.
 
Let's look at one row. Suppose the length of the canvas is L and the length of each rectangle is x.

Now you will have space-rectangle-space-rectangle-...-rectangle-space.

Now how many rectangles you can put really depends on how much space you want between the rectangle. If the space is going to be big, then maybe you can fit only one (or even none!) rectangle in a row.

If you think about it, you will realize that there will be one more space than rectangles. Let the space be s. Let n be how many rectangles you can put in a row. So in total you will have nx + (n+1)s = total length of the canvas (which you can cut??)

nx + (n+1)s = nx + ns + s = n(x+s) + s = L (total length). Then n = (L-s)/(x+s). If this is an integer (1, 2, 3, etc, NOT 2.5 or 3 3/4) then this fine. If it is not an integer you can cut the canvas OR you can change s so that you do get an integer.
So "n" in this case would be the number of rectangles in a row and "s" would be space between this rectanlges in one row?
In these final equation => n = (L-s)/(x+s) i would have to know this space between rectangles and that is exactly what Im looking for and also number of rectangles in a row is also unknown so I dont know how would this work or Im missing something? For me to find "s" first i have to know number of rectangles in a row but to find "n" first I need to find space between them "s"?
I actually find I solution yesterday myself so I you want to hear it I will post it here. (Maybe their is a mistake so you can point it out).
 
Fine, then solve for s and get s = (nx-L)/(n-1). Now after you pick n you can get s. There are multiple choices for n and s so you need to choose one to get the other. There is not just one solution!
 
Top