How many rectangles fit in a triangle?

  • Context: Undergrad 
  • Thread starter Thread starter benbenny
  • Start date Start date
  • Tags Tags
    Fit Triangle
Click For Summary
SUMMARY

The maximum number of whole rectangles that can fit into a triangle can be calculated using specific formulas based on the triangle's side lengths (t1, t2, t3) and rectangle dimensions (r1, r2). The calculations involve determining the number of rectangles that fit in both portrait and landscape orientations, utilizing rounding functions for accuracy. The process requires iterating through various configurations and applying trigonometric functions to account for the triangle's angles. The final solution involves 18 calculations to ensure the maximum number of rectangles is identified.

PREREQUISITES
  • Understanding of basic geometry, particularly triangle properties.
  • Familiarity with trigonometric functions, including tangent and arccosine.
  • Knowledge of mathematical summation notation and floor/ceiling functions.
  • Proficiency in using Excel for mathematical calculations and simulations.
NEXT STEPS
  • Research the application of trigonometric functions in geometric calculations.
  • Learn about recursive algorithms for optimizing space utilization in geometric shapes.
  • Explore advanced mathematical summation techniques and their applications.
  • Investigate Excel functions for implementing complex mathematical formulas efficiently.
USEFUL FOR

Mathematicians, computer scientists, and engineers interested in geometric optimization, as well as anyone looking to solve spatial problems involving rectangles and triangles.

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 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 32 ·
2
Replies
32
Views
2K
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
619
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
2
Views
3K