0
$\begingroup$

Is there a formula/calculation to work out how to find the other $2$ coordinates for a rectangle if you only have the bottom left and top right coordinates?

e.g. My bottom-left coordinate would be $(-1, 0)$ and top right would be $(3, -2)$, I can work out the midpoint but I can't seem to get my head around how to work out the other $2$ coordinates?

  • 0
    Have you drawn a picture?2011-11-24
  • 0
    I think that solution isn't unique...2011-11-24
  • 0
    @pedja If it is given that the two points given are diagonal such as in the OP's example, then a unique rectangle is determined.2011-11-24
  • 0
    Its a formula I need for programming, obviously drawing it out I can work it out but was wondering if the was a general rule of calculation to work it out?!2011-11-24
  • 0
    @RagibZaman,I am not sure about that..draw the circle with radius half of the diagonal and midpoint as center then each point on the circle can be vertice point of the rectangle2011-11-24

3 Answers 3

3

Let's observe picture below. Each point $(x,y)$ of the circle that satisfy following equality can be vertice point of the rectangle :

$\left(\sqrt{(x_A-x)^2+(y_A-y)^2}\right)^2 + \left(\sqrt{(x_C-x)^2+(y_C-y)^2}\right)^2=\left(\sqrt{(x_A-x_C)^2+(y_A-y_C)^2}\right)^2$ ,

where $A(-1,0)$ , and $C(3,-2)$ are given vertices.

For example if you choose point $B_1$ you can calculate coordinates of $D_1$ by using equalities :

$x_{D_1}=2x_O-x_{B_1}$ , and $y_{D_1}=2x_O-y_{B_1}$

Answer to sub question :

If you have length of one edge , let's say $|\bar{AB_1}|$ then you can write an extra equality :

$ |\bar{AB_1}|= \sqrt{(x_A - x)^2+(y_A-y)^2}$ , and find relation between $x$ and $y$ coordinates.

enter image description here

  • 0
    Hey pedja, thanks for the graphics but how would I find out what B1 actually is?!2011-11-24
  • 0
    @robbo77,coordinates of $B_1$ must satisfy square-root equality above...2011-11-24
  • 0
    You can chose $B_1$ freely as any point on the circle. The last corner is that directly opposite it. In Pedja's graphic, $AB_1CD_1$ and $AB_2CD_2$ are two different rectangles that both have AC as diagonal, so you won't get a _unique_ solution without adding more constraints (such as "the edges must be parallel to the coordinate system axes).2011-11-24
  • 0
    Ahhh, now I've got there!! SO basically I need to know another coordinate or the length of the sides. Thanks guys!2011-11-24
  • 0
    Sorry to be so pre-school but if I did set a length for one of the edges how would I then find the coordinates?!2011-11-24
2

In your example, the bottom left coordinate is higher up than the top right coordinate.

Suppose that $b

Other cases can be worked out similarly.

  • 0
    Thanks Joe, just noticed I had my numbers mixed up!!2011-11-24
0

I agree with top left coordinate would be (a,d) and the bottom right would be (c,b). But, it is taking an assumption that the rectangle is not rotated. If rectangle is rotated wrt to our x,y coordinates then we need to transform our x,y axis.