I was trying to derive the formula for the foot of the perpendicular of a point $(x_0,y_0,z_0)$ on the line $L_1:\dfrac{x-x_1}{l}=\dfrac{y-y_1}{m}=\dfrac{z-z_1}{n}$, where $\left<l,m,n \right>$ are the direction cosines of the line. I did so by assuming that the foot of the perpendicular in parametric form $(x_1+\lambda l,y_1+\lambda m, z_1+\lambda n)$ and setting the dot product of the direction ratio of the line joining the foot of the perpendicular to $(x_0,y_0,z_0)$ and $\left<l,m,n \right>$ equal to $0$;
$$l(x_1+\lambda l-x_0)+m(y_1+\lambda m - y_0)+n(z_1+\lambda n - z_0)=0 \implies \lambda= lx_0+my_0+nz_0-(lx_1+my_1+nz_1)$$ since $l^2+m^2+n^2=1$.
Suppose, that the equation of the plane passing through $(x_0,y_0,z_0)$ perpendicular to $L_1$ is $\pi_0:lx+my+nz=d_0$ and the equation of the plane perpendicular to $L_1$ passing through $(x_1,y_1z_1)$ is $\pi_1:lx+my+nz=d_1$. Then, $\lambda=d_0-d_1$ which is very similar to the formula for the distance between the planes $\pi_0$ and $\pi_1$ which I found here: Deriving the formula for distance between two parallel planes $D=|d_0-d_1|$
Is this a mere coincidence or is there some deeper underlying connection herein? I drew a rough figure but that didn't help much. Moreover, my question is, why is the parameter for the foot of the perpendicular of a point on a line equal to the distance between these two particular parallel planes perpendicular to the line?
EDIT: I figured it out with some help from a friend, and thanks for the comment;
The distance of the foot of the perpendicular to be determined from the reference point on the line $(x_1,y_1,z_1)$ is $\sqrt{(x_1+\lambda l-x_1)^2+(y_1+\lambda m-y_1)^2+(z_1+\lambda n-z_1)^2}=|\lambda|$ which must also be the distance between the parallel planes having the normal $\left<l,m,n \right>$ passing through $(x_1,y_1,z_1)$ and the foot of the perpendicular. Now, the plane containing the foot of the perpendicular herein will also pass through the point $(x_0,y_0,z_0)$ too because the line joining $(x_0,y_0,z_0)$ to the foot of perpendicular (by definition) is perpendicular to the normal of the plane.