Finding a 3rd coordinate of the rectangle points in 3d

1.5k Views Asked by At

I have a 4 3-D-points, each of them has only 2 of 3 known coordinates, as follow (? is unknown here):

P5 (P5x, P5y?, P5z) P6 (P6x, P6y?, P6z) P3 (P3x, P3y, P3z?) P4 (P4x, P4y, P4z?)

They build together a rectangle P3-P4-P5-P6 as follow (blue lines have defined length, the length of yellow lines are to find): enter image description here

How to find missed coordinates P5y, P6y, P3z and P4z?

2

There are 2 best solutions below

1
On BEST ANSWER

We know $P_5P_6=P_3P_4$, so $P_{4z}-P_{3z}=P_{6z}-P_{5z}$ and $P_{4y}-P_{3y}=P_{6y}-P_{5y}$. As a check, we should have $P_{4x}-P_{3x}=P_{6x}-P_{5x}$.

We also know $P_5P_6$ is perpendicular to $P_3P_5$, so $$(P_{5x}-P_{3x})(P_{6x}-P_{5x})+(P_{5y}-P_{3y})(P_{6y}-P_{5y})+(P_{5z}-P_{3z})(P_{6z}-P_{5z})=0$$

That is only three equations in four unknowns, so you need one more equation.

I want to rewrite the equations without subscripts. $$P5(a,x,b), P6(a+c,x+f-e,b+d),P3(a+e,e,b+y), P4(a+c+e,f,b+d+y)$$ where $a$ to $f$ are known, but $x$ and $y$ are not. The last equation becomes $ce+(f-e)(e-x)+dy=0$. Pick any value for $x$, and then $y=(e-f)(e-x)-ce)/d$.

0
On

A rectangle can be defined by one corner point, $A$, and two vectors, $v$ and $w$. Then the four corners would be $A,A+v,A+v+w,A+w$. Taken together, these three vectors contain 9 coordinates, but since you want $v\perp w$, you get one linear constraint, namely $x_vx_w+y_vy_w+z_vz_w=0$. So you are left with $8$ real degrees of freedom.

Now in your case, you have exactly $8$ known coordinates, so at first glance you might be able to determine the rest. But when you look closer, you will see that $x_4-x_3=x_6-x_5$ is one condition for the rectangle, but all four of these numbers are known to you. So one of the numbers you know could be deduced, which means that you have insufficient information to fully determine the rectangle.

So you could say $y_5=a, z_3=b$ and conclude $y_6=y_5-y_3+y_4$ and $z_4=z_3-z_5+z_6$. Using the orithogonality, you'd get one more condition, which would bring you back to a one-parameter family of possible solutions. So let's look more closely at that orthogonality.

$$ A=\begin{pmatrix}x_3\\y_3\\b\end{pmatrix}\qquad v=\begin{pmatrix}x_4-x_3=x_6-x_5\\y_4-y_3\\z_6-z_5\end{pmatrix}\qquad w=\begin{pmatrix}x_5-x_3=x_6-x_4\\a-y_3\\z_5-b\end{pmatrix}$$

So your condition would be

$$(x_4-x_3)(x_5-x_3)+(y_4-y_3)(a-y_3)+(z_6-z_5)(z_5-b)=0$$

This will be a linear equation, something of the form $ca+db+e=0$ for $c,d,e\in\mathbb R$ which you can compute. So you simply write $b=-\frac{ca+e}{d}$ and end up with a single variable $a$ which describes all your possible rectangles.