Finding a 3rd point in a 3D triangle with known plane, two points and lengths of each side

2.7k Views Asked by At

I have a very similar problem to the below question.

right triangle in 3D space, vectors, line intersection?

Rather than having the unit vector $A$ I have the lengths $i_2$ to $i_3$ and $i_1$ to $i_3$.

I have the unit vector $C$ and the unit vector of the plane on which the triangle sits.

As above I know both $i_2$ and $i_1$ in $x,y,z$ coordinates.

Could anyone help me with adapting the solution to the above problem compensating for the fact I haven't been able to supply the unit vector C?

Thanks in advance

2

There are 2 best solutions below

2
On

Interpretation:

Given two points $P = (x_1, y_1, z_1)$ and $Q = (x_2, y_2, z_2)$ you want to determine a third point $S = (x_3, y_3, z_3)$.

You have $\lvert PS \rvert = L_1$ and $\lvert QS \rvert = L_2$ and a normal vector $n = (x_n, y_n, z_n)$ of the plane $E$ where all three points are a part of.

Solution:

The above defines two circles, each the intersection of a sphere with the plane $E$: $$ C_1 = B(P, L_1) \cap E \\ C_2 = B(Q, L_2) \cap E $$ whose intersection has either zero, one or two solutions.

This leads to the equations $$ (x - x_1)^2 + (y - y_1)^2 + (z - z_1)^2 = L_1^2 \\ (x - x_2)^2 + (y - y_2)^2 + (z - z_2)^2 = L_2^2 \\ n \cdot (x, y, z) = x_n x + y_n y + z_n z = 0 $$ Subtracting the first two gives $$ 2x(x_2 - x_1) + 2 y(y_2 - y_1) + 2 z (z_2 - z_1) + x_1^2 + y_1^2 + z_1^2 - (x_2^2 + y_2^2 + z_2^2) = L_1^2 - L_2^2 \iff (x_2 - x_1, y_2 - y_1, z_2 - z_1) \cdot (x, y, z) = (L_1^2 -L_2^2 + x_2^2 - x_1^2 + y_2^2 - y_1^2 + z_2^2 - z_1^2) / 2 $$ which is the equation of a plane normal to $PQ$.

The decision to solve for which coordinate depends on $n$. At least one of the coordinates of $n$ must be non-zero.

E.g. $x_n \ne 0$, in this case we can solve for $x$: $$ x = (-y_n/x_n) y + (-z_n/x_n) z \\ $$ This can be used in the above long plane equation to get an expression only in $y$ and $z$, which can be either solved for $y$ or $z$. Let us assume we solve for $y$.

Finally we can use these to express both $x$ and $z$ in terms of $y$. Applying it to one of the sphere equations we can solve for $y$, getting zero, one or two solutions. This will then yield the solutions for $z$ and $x$.

So in general the procedure might give zero, one or two candidates for $S$.

0
On

Let $a=\|i_1-i_3\|$, $b=\|i_2-i_3\|$, and $c=\|i_1-i_2\|$.

Rather than going straight into 3D, it's easier to figure some things out for a planar triangle. Specifically, we want the length of the altitude from $i_3$ ("height" of $i_3$ over the $12$ leg), as well as its projection onto that leg.

You can use Heron's Formula to calculate the area $A$ of the triangle from the length of its edges. Then, the altitude (in plane) is $h=2A/c$.

The projection of $i_3$ onto the $12$ edge is $d=a \cos (\angle 213)$. That cosine can be gotten via law of cosines: $\cos (\angle 213)=(c^2+a^2-b^2)/(2ac)$.

In 3D, the altitude is normal to both the given $12$ leg and the normal of the given plane. So, you can take the cross product of those two vectors, normalize, and multiply by $h$:

$\vec{h}_{3D}=h \frac{\vec{n} \times (\vec{i}_2-\vec{i}_1)}{\|\vec{n} \times (\vec{i}_2-\vec{i}_1)\|}$

Then add $d$ times the unit vector from $i_1$ towards $i_2$