Geometry – How to Find Coordinates of a Box X% Bigger than the Original Box

geometrytrianglestrigonometry

So I'm given a box (the inner box in the picture) and I need to figure out the coordinates of the end points of the outer box given only the coordinates of the inner box.

So far I've gotten the length and width of the original box and cut it in half so I could use the Pythagorean theorem to get the length of the line from the center point of the original box to one of the corners. For this example I extended the hypotenuse twice as far and drew the box expanded at that size.

Given the variables I have, what formula can I use to determine the coordinates of this outer box? For the actual application of this the amount the original box expands will be anywhere from 10-100% and the box will not always be a square, but will always be a rectangle. Thanks in advance for your help.

enter image description here

Best Answer

Let a square box be centered in $(x_0,y_0)$ with length $l$. Another box which is $X\%$ bigger in size (length), has its vertices on the following 4 points:$$(x_0+X\%{l\over 2},y_0+X\%{l\over 2})\\(x_0-X\%{l\over 2},y_0+X\%{l\over 2})\\(x_0+X\%{l\over 2},y_0-X\%{l\over 2})\\(x_0-X\%{l\over 2},y_0-X\%{l\over 2})$$

Related Question