[Math] Calculate the distance between point P(1,2,0) and line AB given points A(0,1,2) and B(3,0,1).

analytic geometrygeometryproof-verificationvectors

Calculate the distance between point P(1,2,0) and line AB given points A(0,1,2) and B(3,0,1).

First we must find the parametric equations for the line:

$\vec{AB} = (3,-1,-1) \rightarrow \vec{r} = t(3,-1,-1) + (0,1,2) = (x,y,z)$

So that:
$$x = 3t$$
$$y = -t-1$$
$$z = -t – 2$$

Now we find the plane in which $\vec{AB}$ is the normal vector:

$3x – y – z + D = 0$. For P(1,2,0), D = 1.

Therefore we have the plane $3x – y – z + 1 = 0$.

Now, using the x,y,z values from the parametric equations, $$t = \frac{2}{11}$$.

So we have to calculate the distance between the points $P'(3t,-t-1,-t-2)$ and $P(1,2,0)$.

This distance is: $$d = \frac{3\sqrt22}{11}$$.

Is this correct?

Best Answer

When you are uncertain if your solution is correct, try to solve it using a different approach. Here is an example.

Another way to parametrise the line $\vec{v}(t)$ is to make $\vec{v}(0) = \vec{A} = (0, 1, 2)$, and $\vec{v}(1) = \vec{B} = (3, 0, 1)$, so $$\vec{v}(t) = \vec{A} + t \left ( \vec{B} - \vec{A} \right ) = ( 3 t ,\;\, 1 - t ,\;\, 2 - t )$$ I parametrise my lines this ways very often, because otherwise I seem to get errors. In this form, it is trivial to check that $\vec{v}(t)$ passes through $\vec{A}$ and $\vec{B}$.

When a distance is minimized, distance squared is also minimized. The distance squared between point $\vec{v}(t)$ on the line and point $\vec{C} = (1, 2, 0)$ is $$f(t) = \left ( \vec{v}(t) - \vec{C} \right ) \cdot \left ( \vec{v}(t) - \vec{C} \right ) = (3 t - 1)^2 + (1 - t - 2)^2 + (2 - t - 0)^2$$ i.e. $$f(t) = 11 t^2 - 8 t + 6$$ Such an everywhere continuous and differentiable function reaches its extremum (a minimum or a maximum) at its stationary points where its derivative is zero: $$\frac{d f(t)}{d t} = 22 t - 8 = 0$$ This is trivial to solve for $t$, and of course yields $$t = \frac{8}{22} = \frac{4}{11} \approx 0.36\overline{36}\dots$$ We know from geometry of this particular case that if there is exactly one extremum, it must be the minimum. In this case, it means that $f\left(\frac{4}{11}\right)$ is the minimum distance squared, and that the point closest to $\vec{C}$ on the line is $\vec{v}\left(\frac{4}{11}\right)$.

Therefore, the minimum distance between the line and the point $\vec{C}$ is $\sqrt{f\left(\frac{4}{11}\right)}$, i.e. $$\sqrt{f\left(\frac{4}{11}\right)} = \sqrt{\frac{16}{11} - \frac{32}{11} + 6} = \sqrt{\frac{50}{11}} = \sqrt{\frac{2\cdot5^2}{11}} = 5 \sqrt{\frac{2}{11}}$$

Thus, I agree with Michael Rozenberg. OP seems to have a bug in their calculations; the first one in the equation for the line.

Related Question