Calculate bounds of the inner rectangle of the polygon based on it's constant bounds along with border

652 Views Asked by At

Yesterday I asked this question seems not clear. So, I am writing new question with mathematical terms only.

Here is some points about shapes I used:

  • Square: Rectangle that all angles are 90° & all sides are equal length. So, consider Square also a Rectangle.
  • Triangle: I used an equilateral triangle is a triangle in which all three sides have the same length.
  • Polygon: A finite number of straight line segments connected to form a closed.

So, Here after I use the term Polygon to describe triangle & rectangle shapes when it's required to mention consider this shape as polygone. Becuase, I used triangle (regular polygon) to simplfy the work to find out the formula.

Variables used in this problem:

  • b = Border width

Bounds of Outer Rectangle (r) that enclosing the polygon(p):

  • x = Origin x
  • y = Origin y
  • w = Width
  • h = Height

So, If r = (x,y,w,h) then, Bounds of Inner Rectangle that encloses the inner polygon(p1) (r1) = (x1,y1,w1,h1)

Here, inner polygon = Polygon by subtracting the border width.

What is my final goal:

I should able to calculate inner rectangle boundary of any polygon like below image, I have angles, outer rectangle bounds & border width. The problem is to find out the inner rectangle bounds across to the outer rectangle based on the polygon at that enclosed by inner rectangle.

enter image description here

Problem 1:

Consider a Polygon(p) as a shape of rectangle(r) which has width(w) is 100 & height(h) is 100. The border width of the polygon is 10. The what is the inner boundary of the rectangle that encloses the inner polygon?

Note: I solved it by mind calculation(I didn't took angles in the calculation). But we can't apply this same formula for triangle. So, this is not solution for my problem.

enter image description here

Problem 2:

Consider the polygon (don't consider regulard) with three edges and three vertices & all angles are equal in measure.

If the rectangle(r) boundary is zero & size(w,h) is (100,87) that encloses the polygon(p) along with polygon border width as 10, then

What is the bounds of the inner rectangle(r2) that encloses the inner polygon(p2) ?

enter image description here

Hope I clearly explained the problem. If anything I am missed then please let me know. Thanks in advance.

2

There are 2 best solutions below

1
On

Inner triangle is the image of outer triangle under a homothetic transformation centred at the centre of the triangle.

  • The centre of the triangle is located on the altitude, at $1/3$ of its length starting from the base.

  • The ratio $r$ of the homothety can be computed as the ratio of the distances from the centre to the midpoint of the bases: $$ r={{1\over3}{\sqrt3\over2}100-10\over {1\over3}{\sqrt3\over2}100}= 1-{\sqrt3\over 5}. $$

Inner rectangle is then the image of outer rectangle under the same homothety.

4
On

RectangleBounds

Let us denote width and height of the inner rectangle as $w_\mathrm{in}$ and $h_\mathrm{in}$ respectively. Then, we have, $$w_\mathrm{in} = w-2\sqrt{3}b. \qquad\mathrm{and}\qquad h_\mathrm{in} = h\space–\space3b.$$

Using these results, we can easily derive the coordinates of the four corners of the sought rectangle $P$, $Q$, $R$, and $S$ as given in the diagram.

Frankly, I am not sure whether these are the results you were looking for. If you have doubts you can always comment on this answer no holds barred.