Perpendicular Distance of a Point from a Line – Cartesian form
Foot of perpendicular from a point on the given Line:
Cartesian Form:

Here, the equation of line AB is \(\frac{x-{{x}_{1}}}{a}=\frac{y-{{y}_{1}}}{b}=\frac{z-{{z}_{1}}}{c}\).
Let L be the foot of the perpendicular from P (α, β, γ) on the line \(\frac{x-{{x}_{1}}}{a}=\frac{y-{{y}_{1}}}{b}=\frac{z-{{z}_{1}}}{c}\).
Let the coordinates of L be (x₁ + aλ, y₁ + bλ, z₁ + cλ).
Then the direction ratios of PL are (x₁ + aλ – α, y₁ + bλ – β, z₁ + cλ – γ).
Direction ratios of AB are (a, b, c)
Since PL is perpendicular to AB, a (x₁ + aλ – α) + b (y₁ + bλ – β) + c (z₁ + cλ – γ) = 0
\(\lambda =\frac{a\left( \alpha -{{x}_{1}} \right)+b\left( \beta -{{y}_{1}} \right)+c\left( \gamma -{{z}_{1}} \right)}{{{a}^{2}}+{{b}^{2}}+{{c}^{2}}}\).
Putting the value of λ in (x₁ + aλ, y₁ + bλ, z₁ + cλ) we get the foot of the perpendicular. Now we can get distance PL using the distance formula.