Rectangle co-ordinates on resize

All about geometry

Rectangle co-ordinates on resize

Postby Guest » Mon May 28, 2018 9:41 am

I have 2 rectangles as in the attached image.
Blue Rect(Lets say, w by h -> 300 x 80)
There's a Red Rect inside Blue rect(Lets say, co-ordinates -> Top Left point(75,15)
(w by h -> 48 x 23).

Now if the blue rect is resized to (w by h = 128 x 32), what would be the co-ordinates and width x height of the red rect inside the blue rect of (128 x 32).

Example of rectangle resize
Untitled.png (2.22 KiB) Viewed 208 times

Re: Rectangle co-ordinates on resize

Postby HallsofIvy » Fri Mar 15, 2019 1:35 pm

The outer rectangle is 300 by 80 and is resized to 128 b y 32. That is, horizontally, it is reduced to [tex]\frac{128}{300}= \frac{32}{75}[/tex]. Vertically, it is reduced to [tex]\frac{32}{80}= \frac{2}{5}[/tex]. The horizontal side length of the smaller rectangle is [tex]48\left(\frac{32}{75}\right)= \frac{512}{25}= 20.48[/tex] and the vertical side length is [tex]23\left(\frac{2}{5}\right)= \frac{46}{5}= 9.2[/tex]. The position horizontal and vertical position of the upper left corner is set the same way, [tex]75\left(\frac{32}{75}\right)= 32[/tex] and [tex]15\left(\frac{5}{2}\right)= \frac{75}{2}= 37.5[/tex].

Posts: 51
Joined: Sat Mar 02, 2019 9:45 am
Reputation: 13

Return to Geometry

Who is online

Users browsing this forum: No registered users and 1 guest