Distance between a straight line and a plane in space

Notice the relative positions between a straight line $r$ and a plane $\pi$ to calculate the distance between them:

Find the distance between the straight line $r:x-2=y=z+1$ and the plane $\pi:x+y-2z+3=0$.

We verify that the plane and the straight line are parallel using the scalar product between the governing vector of the straight line, $\vec{v}$, and the normal vector of the plane $\vec{n}$. If the straight line and the plane are parallel the scalar product will be zero: $$\vec{v}\cdot\vec{n}=(1,1,1)\cdot(1,1,-2)=1+1-2=0$$

So they are parallel. We look for a point of the straight line, $Q=(2,0,-1)$, and apply the formula: $$\text{d}(r,\pi)=\text{d}(P,\pi)=\dfrac{|1\cdot2+1\cdot0-2\cdot(-1)+3|} {\sqrt{1^2+1^2+(-2)^2}}=\dfrac{7}{\sqrt{6}}$$

Practice exercises