For a nonzero direction , the projection of onto its line is the closest vector on that line. Choosing the multiple of so that the residual is perpendicular to determines uniquely.给定非零方向向量 ,向量 在这条直线上的正交投影 ,是直线上距离 最近的向量。令 为 的倍数,再要求残差 与 垂直,就能唯一确定 。
The cyan vector moves while the line stays fixed. Its green projection slides along the line; the gold residual connects the projection to the cyan tip. The small right-angle marker follows the projection, showing why this distance is the shortest.青色向量不断转动,投影直线保持不变。绿色投影沿直线移动,金色残差从投影端点连到青色端点。小直角标记始终跟着投影移动,表明这段距离为什么最短。