Distance from a Point to a Line
Distance from point P (position vector p) to the line r = a + λb. The cross product |b × (a−p)| gives the area of the parallelogram with sides b and (a−p); dividing by |b| gives the perpendicular height.
Derivation
Let the line be and the point be with position vector .
The vector from the base point (position vector ) to is .
The area of the parallelogram formed by and is .
This area also equals where is the perpendicular distance from to the line.
Therefore:
Cartesian method (alternative): Find the foot of perpendicular from to the line. The foot is at parameter . Then .
When the point lies on the line: is parallel to , so , giving .