Projection: the closest point
The projection of onto the line through is the closest point on that line:
The error is orthogonal to ; "closest" and "perpendicular error" are the same condition. Projecting onto a subspace (like the column space of a matrix) works identically: drop a perpendicular.