How many rectangles fit in a triangle?

  • Thread starter Thread starter benbenny
  • Start date Start date
  • Tags Tags
    Fit Triangle
Click For Summary
The discussion focuses on calculating the maximum number of whole rectangles that can fit into a triangle given the triangle's side lengths and the rectangle's dimensions. The initial approach involves using a formula that accounts for fitting rectangles in either portrait or landscape orientation, but not both simultaneously. A more complex method is proposed, involving recursive algorithms and multiple rotations of the triangle's sides to determine the optimal arrangement of rectangles. The calculations require iterating through various configurations, resulting in a total of 18 calculations to find the maximum number of rectangles. The proposed methods, while not elegant, can be implemented in Excel for quick results, though they need further testing for accuracy.
benbenny
Messages
38
Reaction score
0
Does anyone know how one could calculate the maximum number of whole rectangles that can fit into a triangle.

Say you know the length of the sides of the triangle (t1,t2,t3) and the of the sides of the rectangle (r1,r2).

Thanks.
 
Physics news on Phys.org
What's the application? Are there any other restrictions that would make it easier?
 
Ive come up with this so far. It only allows to fit the rectangles in portrait or landscape mode, not a combination of both, nor diagonally.

Any triangle can be made into two right triangles (I think).

A given right triangle has bases t1,t2, and hypotenuse t3.

The number of rectangles (r1,r2) that can fit in the first row in the triangle is

N = \downarrow \frac{[(t1-r1)\frac{t2}{t1}]}{r1}

(down arrow denotes rounding down to nearest integer)

The total number of rectangles that can fit in the triangle is then:

N = \Sigma_{n=1} \downarrow \frac{[(t1-nr1)\frac{t2}{t1}]}{r1}

where the sum is from n=1 until the outcome of the expression is zero (I don't know how to denote this mathematically).

This needs to be done twice, the second time you switch between r1 and r2, to find out if landscape or portrait offers the bigger solution.
 
That'd be a nice way if you could prove that they will all be stacked in the same orientation as each other. And allow them to straddle t2.

It seems intuitive that every rectangle should have one side collinear with a side of the triangle or another rectangle, and should be slid up against a side of something. So maybe you can do it with a recursive algorithm that tries every possible position of each new rectangle being added - that won't be too many because there's only a finite number of sides for them to be parallel with, and only a couple of positions along those sides.
 
What do you mean by "straddle t2"?

Thanks for the input!
 
I mean one side of the rectangle is on each side of the perpendicular line (which I think you called t2) that cuts the triangle in two. It seems like your formulae require all rectangles to be butted up against this line.

By the way "floor" and "cieling" functions force rounding down/up. \left\lfloor 3.4 \right\rfloor \left\lceil 3.4 \right\rceil
 
Ok, so here is one way to do it that gets rid of the straddling assumption. But it does not get rid of the same orientation assumption.

If the triangle sides are a,b,c. The number of rectangles that can fit would be

\Sigma_{n=1} \downarrow\frac{d_{n}}{R_{2}}

where

d_n = a - ( \frac{nR_1}{tan(arccos(\frac{-c^2 +a^2+b^2}{2ab}))}+ \frac{nR_1}{tan(arccos(\frac{-b^2 +a^2+c^2}{2ac}))})

Now you have to rotate a-->b b-->c c-->a carry out the calculation again, than rotate again and do it again. You also need to do it twice with R1<-->R2 for every rotation. In total this gives 18 calculations and the biggest figure is the max number of whole rectanlges that can fit.

Its not the most elegant way of doing it, but you can apply it in excel to get quick results.

I haven't tested it yet, so although I am pretty sure about the principle of it, there may be a math error.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 32 ·
2
Replies
32
Views
2K
  • · Replies 2 ·
Replies
2
Views
481
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
5
Views
3K