[Math] Line perpendicular to two skew lines

cross productlinear algebraMATLAB

I have the lines $L_1 = (9,2,0) + s(2,1,0)$ and $L_2 = (7,3,1) + t(0,2,2)$, I'm looking for a line $L_3$ perpendicular to both, regardless of distance/length. The directional vector should be the cross product of $(2,1,0)$ and $(0,2,2)$ obviously (so $(2,-4,4)$). But I was unable to find the "offset point" to $L_3$'s equation(like what $(9,2,0)$ is in $L_1$).

So I found this: Line perpendicular to two other lines – data sufficiency

And I try to calculate that as follows:

$s((2,1,0) \cdot (2,1,0)) – t((2,1,0) \cdot (0,2,2)) = (2,1,0) \cdot ((7,3,1) – (9,2,0)) <=> s(5) – t(2) = -3$
$s((2,1,0) \cdot (0,2,2)) – t((0,2,2) \cdot (0,2,2)) = (0,2,2) \cdot ((7,3,1) – (9,2,0)) <=> s(2) – t(8) = 4 $

I put in $5$ into $L_1$ and $2$ into $L_2$, and I get the points $P1=(19,7,0)$ & $P2=(7,7,3)$. But if I now try to get the directional vector from these two points(so $P2-P1$), I get $(-12,0,3)$, this is nowhere near $(2,-4,4)$, so what did I get there?? What is $(-12,0,3)$ then?

Same thing if I try to put in $s=2$ & $t=8$ , or $s=-3$ & $t=4 $ I get some strange points unrelated to the directional vector $(2,-4,4)$.

When I plot all these three attempts in matlab, I get lines which do intersect both $L_1$ & $ L_2$, but none of them look orthogonal. Here's an example of what it looks like:

enter image description here

And there's this gap between $L_1$ and $L_2$ where $L_3$ should be going through to make it perpendicular to both surely:
enter image description here

So how do I get the actual line equation of the line L3 which is orthogonal to both $L_1$ and $L_2$ regardless of distance or length?

Best Answer

I put in 5 into L1 and 2 into L

Why?

The two equations you derived using the method from Line perpendicular to two other lines - data sufficiency were \begin{align} s(5)−t(2)&=−3\\ s(2)−t(8)&=4. \end{align}

A more usual way to write this is \begin{align} 5s−2t&=−3\\ 2s−8t&=4. \end{align}

Solve these as simultaneous equations. There is only one choice of values for $s$ and $t$ that makes both equations true. That is how you should set $s$ and $t.$