# 向量投影

**向量投影**是一种运算：取一个向量，产生它沿着给定方向或子空间的分量。对于非零向量 \( \mathbf{u} \)，向量 \( \mathbf{v} \) 在 \( \mathbf{u} \) 上的正交投影是与 \( \mathbf{v} \) 最接近的 \( \mathbf{u} \) 的标量倍，由 \( \operatorname{proj}_{\mathbf{u}} \mathbf{v} = \dfrac{\mathbf{v} \cdot \mathbf{u}}{\mathbf{u} \cdot \mathbf{u}} \, \mathbf{u} \) 给出。<sup>[1](https://learn.math101.ca/cheatsheets/linear-algebra-orthogonal-projection/)</sup> 同样的想法可以从单个方向推广到内积空间的任意子空间：投影就是子空间中距离 \( \mathbf{v} \) 最近的那个向量。<sup>[2](https://www.math.brown.edu/streil/papers/LADW/HTML_2026_08-31/Ch5.html)</sup>

| 关键事实 | 细节 |
|---|---|
| 在单个向量上的投影 | 对非零 \( \mathbf{u} \)，\( \operatorname{proj}_{\mathbf{u}} \mathbf{v} = \dfrac{\mathbf{v} \cdot \mathbf{u}}{\mathbf{u} \cdot \mathbf{u}} \, \mathbf{u} \)<sup>[1](https://learn.math101.ca/cheatsheets/linear-algebra-orthogonal-projection/)</sup> |
| 标量投影 | \( \mathbf{u} \) 沿 \( \mathbf{v} \) 方向的分量为 \( \alpha = \langle \mathbf{u}, \mathbf{v} \rangle / \lVert \mathbf{v} \rVert \)，是一个带符号的长度<sup>[3](https://courses.math.wichita.edu/math511/ch5/2/InnerProductSpaces.html)</sup> |
| 定义性质 | 投影 \( \mathbf{w} \) 位于子空间中，残差 \( \mathbf{v} - \mathbf{w} \) 与该子空间正交；这个 \( \mathbf{w} \) 在子空间中的所有 \( \mathbf{x} \) 上唯一地最小化 \( \lVert \mathbf{v} - \mathbf{x} \rVert \)<sup>[2](https://www.math.brown.edu/streil/papers/LADW/HTML_2026_08-31/Ch5.html)</sup> |
| 投影矩阵 | 对于标准正交列 \( Q \)，到其张成空间上的投影是 \( QQ^{T} \)；对于列满秩的 \( A \)，则是 \( A(A^{T}A)^{-1}A^{T} \)<sup>[1](https://learn.math101.ca/cheatsheets/linear-algebra-orthogonal-projection/)</sup> |
| 矩阵性质 | \( P^{2} = P \)；对于正交投影，还有 \( P^{T} = P \)<sup>[4](https://ocw.mit.edu/courses/18-06-linear-algebra-spring-2010/4d876a9159e32543eb0d73b4d4382f4c_MIT18_06S10ZoomNotes.pdf)</sup> |
| 尺度不变性 | 用 \( c\mathbf{u} \)（\( c \neq 0 \)）替换 \( \mathbf{u} \) 不改变投影，因此投影只依赖于 \( \mathbf{u} \) 所张成的直线<sup>[5](https://www.math.purdue.edu/~xu1121/Sec6.2)</sup> |
| 主要应用 | 最小二乘法：拟合值 \( A\hat{\mathbf{x}} \) 是 \( \mathbf{b} \) 在 \( A \) 的列空间上的正交投影<sup>[4](https://ocw.mit.edu/courses/18-06-linear-algebra-spring-2010/4d876a9159e32543eb0d73b4d4382f4c_MIT18_06S10ZoomNotes.pdf)</sup> |

## 定义与几何图像

在平面几何中，一个向量在另一个向量上的投影就是它投下的“影子”：从 \( \mathbf{v} \) 的端点向过 \( \mathbf{u} \) 的直线作垂线，垂足即为投影点。<sup>[6](https://notes.eecs245.org/vectors/projecting-onto-a-single-vector/)</sup> 形式上，\( \mathbf{v} \) 在 \( \mathbf{u} \) 的张成空间上的投影是 \( \lVert \mathbf{v} \rVert \cos\theta \, (\mathbf{u}/\lVert \mathbf{u} \rVert) \)，其中 \( \theta \) 是两向量之间的夹角；因子 \( \lVert \mathbf{v} \rVert \cos\theta \) 确定长度，\( \mathbf{u}/\lVert \mathbf{u} \rVert \) 确定方向。<sup>[7](https://courses.cs.washington.edu/courses/cse446/21sp/sections/02/linear_algebra.html)</sup> 用点积改写 \( \lVert \mathbf{v} \rVert \cos\theta \)，就得到标准公式 \( (\mathbf{u} \cdot \mathbf{v} / \lVert \mathbf{u} \rVert^{2}) \, \mathbf{u} \)。<sup>[7](https://courses.cs.washington.edu/courses/cse446/21sp/sections/02/linear_algebra.html)</sup>

名称中的“正交”指的是误差向量：\( \mathbf{e} = \mathbf{v} - \operatorname{proj}_{\mathbf{u}} \mathbf{v} \) 与 \( \mathbf{u} \) 正交。<sup>[6](https://notes.eecs245.org/vectors/projecting-onto-a-single-vector/)</sup> 这一条件也刻画了投影作为最佳逼近的性质。在所有倍数 \( k\mathbf{u} \) 中，取 \( k^{*} = (\mathbf{u} \cdot \mathbf{v})/(\mathbf{u} \cdot \mathbf{u}) \) 时最接近 \( \mathbf{v} \)，公式正是由此推导出来的：令 \( \mathbf{v} \cdot (\mathbf{v} - k\mathbf{u}) = 0 \)，解出 \( k \)。<sup>[6](https://notes.eecs245.org/vectors/projecting-onto-a-single-vector/)</sup>

若用任意非零标量 \( c \) 重新缩放 \( \mathbf{u} \)，投影不变，因为因子 \( c \) 在分子分母之间相消；投影由 \( \mathbf{u} \) 所张成的直线决定，而与直线上选取的具体向量无关。<sup>[5](https://www.math.purdue.edu/~xu1121/Sec6.2)</sup>

## 正交分解

每个投影都把向量拆成两部分。记 \( \mathbf{p} = \operatorname{Proj}_{\mathbf{v}} \mathbf{u} \)，\( \mathbf{r} = \mathbf{u} - \mathbf{p} \)，则 \( \mathbf{p} \) 与 \( \mathbf{v} \) 平行，残差 \( \mathbf{r} \) 与 \( \mathbf{v} \) 正交，而 \( \mathbf{u} = \mathbf{p} + \mathbf{r} \) 称为 \( \mathbf{u} \) 关于 \( \mathbf{v} \) 的正交分解。<sup>[3](https://courses.math.wichita.edu/math511/ch5/2/InnerProductSpaces.html)</sup> 这两部分彼此正交；\( \mathbf{u} \) 与 \( \mathbf{v} \) 平行当且仅当 \( \mathbf{u} = \mathbf{p} \)，即残差为零。<sup>[3](https://courses.math.wichita.edu/math511/ch5/2/InnerProductSpaces.html)</sup>

一个算例可以展示具体运算。将 \( \mathbf{v} = (3,1,2) \) 投影到 \( \mathbf{u} = (1,1,0) \) 张成的直线上。系数为 \( (\mathbf{v} \cdot \mathbf{u})/(\mathbf{u} \cdot \mathbf{u}) = 4/2 = 2 \)，所以 \( \mathbf{p} = 2\mathbf{u} = (2,2,0) \)，残差为 \( \mathbf{r} = (1,-1,2) \)，它与 \( \mathbf{u} \) 的点积为 \( 1 - 1 = 0 \)。直线上任意其他点 \( c\mathbf{u} \) 的平方距离为 \( 6 + 2(2-c)^{2} \geq 6 \)，这验证了投影就是最近点。<sup>[1](https://learn.math101.ca/cheatsheets/linear-algebra-orthogonal-projection/)</sup>

## 到子空间上的投影

单向量公式可以推广到任何具有正交基的有限维子空间。若 \( W \subset \mathbb{R}^{n} \) 具有正交基 \( \{\mathbf{f}_{1}, \dots, \mathbf{f}_{m}\} \)，则 \( \mathbf{x} \) 在 \( W \) 上的投影是它在各基向量上投影之和，<sup>[8](https://mathbooks.unl.edu/LinearAlgebra/Section-Orthogonality-and-Projections.html)</sup>

\[ \operatorname{proj}_{W}(\mathbf{x}) = \sum_{k=1}^{m} \frac{\mathbf{x} \cdot \mathbf{f}_{k}}{\lVert \mathbf{f}_{k} \rVert^{2}} \, \mathbf{f}_{k}. \]

在特雷尔（Treil）的《线性代数正误》（*Linear Algebra Done Wrong*）的记号中，内积空间 \( V \) 的子空间 \( E \) 上的正交投影 \( P_{E}\mathbf{v} \) 是满足 \( \mathbf{v} - \mathbf{w} \perp E \) 的向量 \( \mathbf{w} \in E \)；它存在、唯一，并且最小化 \( \mathbf{v} \) 到 \( E \) 的距离。<sup>[2](https://www.math.brown.edu/streil/papers/LADW/HTML_2026_08-31/Ch5.html)</sup> 同一文献指出，\( P_{E} \) 是线性变换，这直接由求和公式可得。<sup>[2](https://www.math.brown.edu/streil/papers/LADW/HTML_2026_08-31/Ch5.html)</sup>

**投影矩阵。** 由于投影是线性的，它可以用矩阵 \( P \) 表示。若 \( Q \) 的列是标准正交的，则到其张成空间上的投影为 \( QQ^{T}\mathbf{v} \)；对于列满秩但列仅线性无关的矩阵 \( A \)，则为 \( A(A^{T}A)^{-1}A^{T}\mathbf{v} \)。<sup>[1](https://learn.math101.ca/cheatsheets/linear-algebra-orthogonal-projection/)</sup> 每个投影矩阵都满足 \( P^{2} = P \)，因为对已经投影过的向量再投影不会改变任何东西；正交投影还额外满足 \( P^{T} = P \)。<sup>[4](https://ocw.mit.edu/courses/18-06-linear-algebra-spring-2010/4d876a9159e32543eb0d73b4d4382f4c_MIT18_06S10ZoomNotes.pdf)</sup>

当子空间由张成集而非正交基给出时，投影可以通过解线性方程组来计算：把子空间写成矩阵 \( A \) 的列空间，则 \( \mathbf{b} \) 的投影为 \( A\mathbf{x} \)，其中 \( \mathbf{x} \) 是 \( A^{T}A\mathbf{x} = A^{T}\mathbf{b} \) 的任一解，而这个方程总是相容的。<sup>[9](https://textbooks.math.gatech.edu/ila/projections.html)</sup>

## 最小二乘法

投影的观点构成了最小二乘法的基础。当 \( A\mathbf{x} = \mathbf{b} \) 无解时，最好的做法是最小化 \( \lVert \mathbf{b} - A\mathbf{x} \rVert \)；从几何上看，\( A\mathbf{x} \) 必须是 \( \mathbf{b} \) 在 \( A \) 的列空间上的投影，误差向量 \( \mathbf{e} = \mathbf{b} - \mathbf{p} \) 与该空间正交。<sup>[4](https://ocw.mit.edu/courses/18-06-linear-algebra-spring-2010/4d876a9159e32543eb0d73b4d4382f4c_MIT18_06S10ZoomNotes.pdf)</sup> 正交条件 \( A^{T}(\mathbf{b} - A\mathbf{w}) = \mathbf{0} \) 给出正规方程 \( A^{T}A\mathbf{w} = A^{T}\mathbf{b} \) 及其解 \( \mathbf{w} = (A^{T}A)^{-1}A^{T}\mathbf{b} \)。<sup>[7](https://courses.cs.washington.edu/courses/cse446/21sp/sections/02/linear_algebra.html)</sup> 在回归中，将 \( \mathbf{b} \) 投影到全一向量张成的空间上，得到的向量在每个坐标上的值都是 \( \mathbf{b} \) 的均值。<sup>[10](https://dats.columbian.gwu.edu/courses/data-mining/week-3/projection.html)</sup>

这一方法本身有一段有据可查的历史：勒让德（Legendre）于1805年首次发表最小二乘法，作为其彗星轨道著作中题为“论最小二乘法”的附录；高斯（Gauss）于1809年发表了自己的论述，并声称自1795年起就使用了这一原理，这引发了旷日持久的优先权之争。<sup>[11](https://en.wikisource.org/wiki/Page%3AA_Source_Book_in_Mathematics_%28Smith%29.pdf/608)</sup>

## 正交投影与斜投影

正交投影是一般投影的特例。一般投影是满足 \( P^{2} = P \) 的线性映射 \( P \)，其值域与核是互补子空间。当值域与核不是正交补时，该投影称为斜投影。<sup>[12](https://uamte.math.byu.edu/~bakker/Math346/BeamerSlides/Lec31.pdf)</sup> 在内积本身是一种选择的应用中，这一区别很重要：改变希尔伯特空间的内积可以把斜投影变成正交投影，此时它产生的重构就是在新范数下的最小范数信号。<sup>[13](https://webee.technion.ac.il/Sites/People/YoninaEldar/Download/WE03c.pdf)</sup> 加权最小二乘法同理：加权问题可以重新解释为加权内积下的正交投影。<sup>[14](https://repository.tudelft.nl/file/File_6d53e300-a826-478a-9d6d-d2951c84e349)</sup>

## 常见错误

教学资料指出了三类反复出现的错误：在向 \( \mathbf{u} \) 投影时除以 \( \mathbf{v} \cdot \mathbf{v} \) 而非 \( \mathbf{u} \cdot \mathbf{u} \)；把标准正交基公式用于线性无关但并不正交的向量；以及只检查结果位于子空间中，却不验证残差与该子空间正交。<sup>[1](https://learn.math101.ca/cheatsheets/linear-algebra-orthogonal-projection/)</sup>

## References

1. [Orthogonal Projection Cheat Sheet, Math101.ca](https://learn.math101.ca/cheatsheets/linear-algebra-orthogonal-projection/)
2. [S. Treil, Linear Algebra Done Wrong, Chapter 5: Inner product spaces](https://www.math.brown.edu/streil/papers/LADW/HTML_2026_08-31/Ch5.html)
3. [Inner Product Spaces, Wichita State University MATH 511 notes](https://courses.math.wichita.edu/math511/ch5/2/InnerProductSpaces.html)
4. [Zoom Notes for MIT 18.06 Linear Algebra, Spring 2010](https://ocw.mit.edu/courses/18-06-linear-algebra-spring-2010/4d876a9159e32543eb0d73b4d4382f4c_MIT18_06S10ZoomNotes.pdf)
5. [Section 6.2 Orthogonal Sets, Purdue University](https://www.math.purdue.edu/~xu1121/Sec6.2)
6. [Projecting onto a Single Vector, EECS 245 Course Notes](https://notes.eecs245.org/vectors/projecting-onto-a-single-vector/)
7. [Linear Algebra review notes, CSE 446, University of Washington](https://courses.cs.washington.edu/courses/cse446/21sp/sections/02/linear_algebra.html)
8. [Orthogonality and Projections, University of Nebraska–Lincoln linear algebra text](https://mathbooks.unl.edu/LinearAlgebra/Section-Orthogonality-and-Projections.html)
9. [Orthogonal Projection, Interactive Linear Algebra, Georgia Tech](https://textbooks.math.gatech.edu/ila/projections.html)
10. [Projection and Orthogonality, Introduction to Data Mining, George Washington University](https://dats.columbian.gwu.edu/courses/data-mining/week-3/projection.html)
11. [Legendre, On Least Squares, in A Source Book in Mathematics (Smith), Wikisource](https://en.wikisource.org/wiki/Page%3AA_Source_Book_in_Mathematics_%28Smith%29.pdf/608)
12. [Projections, BYU Math 346 lecture slides](https://uamte.math.byu.edu/~bakker/Math346/BeamerSlides/Lec31.pdf)
13. [Y. C. Eldar, Sampling theory with oblique and orthogonal projections under changing inner products](https://webee.technion.ac.il/Sites/People/YoninaEldar/Download/WE03c.pdf)
14. [Adjustment Theory, TU Delft repository](https://repository.tudelft.nl/file/File_6d53e300-a826-478a-9d6d-d2951c84e349)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Linear and multilinear algebra › Vector spaces and linear maps

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/vector-projection

English original: https://www.edgepedia.org/vector-projection
