Alternative solution:
The equation of the plane $\Pi_1$ which is defined by the 2 linearly independent vectors $\vec a= (3,1,-1)$ and $\vec b = (1,-2,1)$ is:
$$\begin{vmatrix}x & y & z \\ 3 & 1 & -1 \\ 1 &- 2 & 1 \end{vmatrix}=0\implies-x-4y-7z=0$$
So, we have $\Pi_1 :-x-4y-7z=0$
Now, we know that if there is $d'\in \mathbb R$, such that $\Pi_1:ax+by+cz=d$ and $\Pi_2:ax+by+cz=d' \iff \Pi_1 \parallel \Pi_2$.
So, $\Pi_2: -x-4y-7z=d'$. We already know that $(3,4,-5) \in \Pi_2\implies d'=16$.
Done.
Given two lines in ${\mathbb{R}^3}$ by:
$$\begin{gathered}
X = P + r \cdot U \hfill \\
Y = Q + s \cdot V \hfill \\
\end{gathered} $$
Here we use $P,Q \in {\mathbb{R}^3}$ as "starting" points and $U,V \in {\mathbb{R}^3}$ as directions.
We take the blue line for our first paramtrization and the orange one for second. Both lines have edges of the cube in common, but different ones.
Blue line has bottom face and orange line has top face from the cube in common.
So these planes are parallel to each other.
Because lines have different directions, they aren't parallel.
We want to calculate the shortest distance of the two given lines.
The distance of two arbitrary points (here the red segment) seems not
to have shortest lenght. The green segment looks much better.
But what can we say about the green segment? The cube help's us to find the
answer quickly: The green segment is that edge of the cube, that joines
the blue line with the orange one and is perpendicular with both lines.
This makes the green segment very special. But why?
There is one very good reason. From the given directions $U,V \in {\mathbb{R}^3}$ we can build the vector or cross product $U \times V$
and we know the dots from $U \times V$ with $U$ and from $U \times V$
with $V$ are zero. That is $U \times V \bot U$ and $U \times V \bot V$.
This is important for our calculation. Let's go:
The red segment starts in point $X$ from the blue line and ends in point
$Y$ from the orange line. We write for direction vector from $X$ towards
$Y$:
$$\begin{gathered}
\overrightarrow {XY} = Y - X \hfill \\
\overrightarrow {XY} = s \cdot V - r \cdot U + \overrightarrow {PQ} \hfill \\
\end{gathered} $$
And of course, here $\overrightarrow {PQ} = Q - P$ is the vector which starts
in $P$ and ends in $Q$.
For the green segment we use point $A$ from the blue line as starting point and
$B$ from the orange line as ending point. And we write $\overrightarrow {AB} = B - A$ as usual for direction.
But, do you remember? $\overrightarrow {AB} $ has same direction as $U \times V$! We can say this more precise:
$$\overrightarrow {AB} = t \cdot U \times V$$
for a number $t \in \mathbb{R}$.
And now, we want the direction $\overrightarrow {XY} $ to be $\overrightarrow {AB} $. Well that is
$$\begin{gathered}
\overrightarrow {AB} = \overrightarrow {XY} \hfill \\
\hfill \\
t \cdot U \times V = s \cdot V - r \cdot U + \overrightarrow {PQ} \hfill \\
\end{gathered}$$
Why are we doing this? We want to find that number $t \in \mathbb{R}$.
And in less than a second, we are done. Applying the dot with $U \times V$
in last equation gives instantly:
$$\begin{gathered}
t \cdot \left( {U \times V \cdot U \times V} \right) = s \cdot \left( {V \cdot U \times V} \right) - r \cdot \left( {U \cdot U \times V} \right) + \overrightarrow {PQ} \cdot U \times V \hfill \\
\hfill \\
t \cdot {\left\| {U \times V} \right\|^2} = \overrightarrow {PQ} \cdot U \times V \hfill \\
\end{gathered} $$
because $U \cdot U \times V = V \cdot U \times V = 0$. At this point we can't calculate on without an assumption. To eliminate for $t$ we have to divide with
${\left\| {U \times V} \right\|^2}$. If the directions $U,V \in {\mathbb{R}^3}$ for our lines are linear independent, then $U \times V \ne \vec 0$ and has a length different from zero. So we get for $t$:
$$t = \frac{{\overrightarrow {PQ} \cdot U \times V}}{{{{\left\| {U \times V} \right\|}^2}}}$$
And also we get the shape for
$$\overrightarrow {AB} = \frac{{\overrightarrow {PQ} \cdot U \times V}}{{{{\left\| {U \times V} \right\|}^2}}} \cdot U \times V$$
What about the length for this $\overrightarrow {AB} $? Here it is:
$$\begin{gathered}
\overrightarrow {AB} \cdot \overrightarrow {AB} = {\left\| {\overrightarrow {AB} } \right\|^2} = \frac{{\overrightarrow {PQ} \cdot U \times V}}{{{{\left\| {U \times V} \right\|}^2}}} \cdot \frac{{\overrightarrow {PQ} \cdot U \times V}}{{{{\left\| {U \times V} \right\|}^2}}} \cdot {\left\| {U \times V} \right\|^2} \hfill \\
\hfill \\
{\left\| {\overrightarrow {AB} } \right\|^2} = \frac{{{{\left( {\overrightarrow {PQ} \cdot U \times V} \right)}^2}}}{{{{\left\| {U \times V} \right\|}^2}}} \hfill \\
\hfill \\
\left\| {\overrightarrow {AB} } \right\| = \frac{{\left| {\overrightarrow {PQ} \cdot U \times V} \right|}}{{\left\| {U \times V} \right\|}} \hfill \\
\end{gathered} $$
And if we re-write: $\overrightarrow {PQ} = Q - P$
$$\left\| {\overrightarrow {AB} } \right\| = \frac{{\left| {(Q - P) \cdot U \times V} \right|}}{{\left\| {U \times V} \right\|}}$$
So:
Given two lines in $\phi ,\psi \subset {\mathbb{R}^3}$ with points $P,Q \in {\mathbb{R}^3}$ and directions $U,V \in {\mathbb{R}^3}$, that are of shape:
$$\begin{gathered}
\phi = P + r \cdot U \hfill \\
\psi = Q + s \cdot V \hfill \\
\end{gathered}$$
then, if $U$ and $V$ are linear independent, their distance is given by:
$$d(\phi ,\psi ) = \frac{{\left| {(Q - P) \cdot U \times V} \right|}}{{\left\| {U \times V} \right\|}}$$
In my opinion it's important to make a difference between points and vectors. Because points are no vectors. Points can not be added. The difference between two points is a vector. And if I add to a point a vector I get a point. In your formula I would replace "vectors" $\overrightarrow {{v_1}} ,\overrightarrow {{v_2}} $ by points, because these are points. And points didn't have overarrows.
Thank you for listening!
Best Answer
Okay @AlexeyBurdin has pointed out my mistake essentially I got the cross product wrong in both methods, but they should both work, I'm just going to put this correction up and what the subsequent answer should be for anyone else who runs into this problem again.
The reason is the for the matrix $$ A=\begin{pmatrix} a & b & c\\ d & e & f\\ g & h & i\\ \end{pmatrix} $$ |A| = a(ei − fh)
−
b(di − fg) + c(dh − eg)And the minus in the middle is what I forgot about which lead to the rest of my workings being wrong and finding the determinant of a 3 x 3 matrix is part of what the cross product is.
First method:
$$ \overrightarrow b × \overrightarrow c = (4-6)\overrightarrow i - (2-12) \overrightarrow j + (2-8) \overrightarrow k $$ $$ \overrightarrow b × \overrightarrow c = -2\overrightarrow i +10 \overrightarrow j -6 \overrightarrow k $$ $$ \overrightarrow a⋅(\overrightarrow b × \overrightarrow c) = (2*-2) + (-2 *10) + (c* -6) = 0 $$ $$ \overrightarrow a⋅(\overrightarrow b × \overrightarrow c) = -4 - 20 -6c = 0 $$ $$ -6c = 24 $$ $$ c = -4 $$
Second method:
$$ \overrightarrow {PQ} = \overrightarrow Q - \overrightarrow P = (1,2,3) $$ $$ \overrightarrow {PR} = \overrightarrow R - \overrightarrow P = (4,2,2) $$ Next I crossed $\overrightarrow {PQ} × \overrightarrow {PR}$ to find the tangent vector which is the coefficients for the equation of the plane where the tangent vector = (a,b,c) and the equation of the plane is $a(x-x0) + b(y-y0) + c(z-z0) = 0$. $$\overrightarrow {PQ} × \overrightarrow {PR}= -2\overrightarrow i +10 \overrightarrow j -6 \overrightarrow k $$ Thus, the equation for the tangent plane is: $$-2(x-x0) +10(y-y0) + -6(z-z0) = 0$$ Substituting any random easy point on the plane (0,0,0). $$-2x +10y -6z = 0$$ Substituting the point in question that must be on the plane(2, -2, c). $$-2(2) +10(-2) -6c = 0$$ $$-2(2) +10(-2) -6c = 0$$ $$-2(2) +10(-2) -6c = 0$$ $$-24-6c = 0$$ $$-6c = 24$$ $$c = -4$$