Find rectangle vertices from 4 points located at rectangle faces.

386 Views Asked by At

If I have 4 points: $P_a$, $P_b$, $P_c$, and $P_d$. And each of these points lies on a different face of a rectangle, how do I find the vertices ($V_1$,$V_2$,$V_3$, and $V_4$) of this rectangle?

Rectangle with vertices v1,v2,v3 and v4

Graphical setup of the problem

Thank you!

1

There are 1 best solutions below

6
On BEST ANSWER

There are many such rectangles.

Let $La$ be any line through $Pa$. Let $Lb$ and $Ld$ be the lines through $Pb$ and $Pd$ perpendicular to $La$. Then let $Lc$ be the line through $Pc$ parallel to $La$. Those four lines will intersect at the vertices of a rectangle of the kind you seek, as long as the points $Px$ are interior to the segments defined by the vertices. That will be true for a whole range of lines $L$.

You can see that in the picture in the question: just imagine rotating the edge through $Pa$ a little bit and adjusting the other edges so as to keep the right angles.

There will be cases when there is no rectangle - one of the four points might be inside the triangle formed by the other three. There will be edge cases - what if three of the points are collinear?