# 单位向量

单位向量是范数（即长度）等于1的向量。<sup>[1](https://secure.maths.usyd.edu.au/u/daners/publ/vector-calculus/chapter-vectors-5.html)</sup> 这个定义在任何赋范向量空间中都有意义，因此在赋范向量空间中，单位向量就是满足该空间范数下 \( \|\mathbf{v}\| = 1 \) 的任意向量 \( \mathbf{v} \)。<sup>[2](https://www.sciencedirect.com/topics/mathematics/unit-vector)</sup> 单位向量承载方向而不含大小，这使它们成为几何学、物理学和工程学中表达方向的标准方式。

| 关键事实 | 详情 |
|---|---|
| 定义 | 满足 \( \|\mathbf{x}\| = 1 \) 的向量 \( \mathbf{x} \)；\( \mathbb{R}^N \) 中的范数为 \( \|\mathbf{x}\| = \sqrt{x_1^2 + \cdots + x_N^2} \)<sup>[1](https://secure.maths.usyd.edu.au/u/daners/publ/vector-calculus/chapter-vectors-5.html)</sup> |
| 归一化 | 对任意非零向量 \( \mathbf{v} \)，\( \mathbf{u} = \mathbf{v}/\|\mathbf{v}\| \) 是沿 \( \mathbf{v} \) 方向的单位向量<sup>[3](https://pressbooks.cuny.edu/mat5600linearalgebra/chapter/chapter-2/)</sup> |
| 记号 | 单位向量用帽子记号 \( \hat{\mathbf{v}} \) 表示，这一记号专用于单位长度的向量<sup>[4](https://odp.library.tamu.edu/math150-2nd-ed/chapter/9-1-vectors/)</sup> |
| 笛卡尔单位向量 | \( \mathbf{i} \)、\( \mathbf{j} \) 和 \( \mathbf{k} \) 分别指向固定笛卡尔坐标系中 x、y、z 轴的正方向<sup>[2](https://www.sciencedirect.com/topics/mathematics/unit-vector)</sup> |
| 零向量 | 零向量无法归一化，因为其范数为零，而除以零是未定义的<sup>[5](https://codemia.io/knowledge-hub/path/how_to_normalize_a_numpy_array_to_a_unit_vector)</sup> |
| 单位球 | 在配备点积的 \( \mathbb{R}^2 \) 中，单位向量的集合是圆 \( x^2 + y^2 = 1 \)；在加权内积下则变为椭圆<sup>[6](https://ximera.osu.edu/oerlinalg/LinearAlgebra/VSP-0070/main)</sup> |
| 软件 | NumPy 的 `linalg.norm` 计算向量范数以进行归一化，scikit-learn 的 `normalize` 默认使用 L2 范数将每个样本缩放为单位范数<sup>[7](https://numpy.org/doc/2.0/reference/generated/numpy.linalg.norm.html)</sup><sup> • </sup><sup>[8](https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.normalize.html)</sup> |

## 定义与范数

\( \mathbb{R}^N \) 中向量 \( \mathbf{x} = (x_1, \dots, x_N) \) 的范数由标量（点）积定义为

\[ \|\mathbf{x}\| := \sqrt{\mathbf{x} \cdot \mathbf{x}} = \sqrt{\sum_{i=1}^{N} x_i^2}. \]

对于平面和空间中的向量，毕达哥拉斯定理表明这个数就是向量的几何长度，而在更高维中“长度”一词仍被用来指称范数。<sup>[1](https://secure.maths.usyd.edu.au/u/daners/publ/vector-calculus/chapter-vectors-5.html)</sup> 范数为1的向量称为单位向量，也说它是归一化的。<sup>[9](https://www.math.hkust.edu.hk/~mabfchen/Math111/Week13-14.pdf)</sup> 这一概念可推广到欧几里得空间之外：在任何内积空间 \( V \) 中，范数为 \( \|\mathbf{v}\| = \sqrt{\langle \mathbf{v}, \mathbf{v} \rangle} \)，范数为1的向量就是 \( V \) 的单位向量。<sup>[6](https://ximera.osu.edu/oerlinalg/LinearAlgebra/VSP-0070/main)</sup>

所有单位向量的集合取决于所选的范数。在 \( \mathbb{R}^2 \) 上取标准点积时，单位向量构成以原点为圆心的圆 \( x^2 + y^2 = 1 \)。若内积改为由 \( \langle \mathbf{v}, \mathbf{w} \rangle = xx_1/a^2 + yy_1/b^2 \) 定义（其中 \( a \) 和 \( b \) 为正的常数），则单位向量满足 \( x^2/a^2 + y^2/b^2 = 1 \)，即一个椭圆。<sup>[6](https://ximera.osu.edu/oerlinalg/LinearAlgebra/VSP-0070/main)</sup> 在一般赋范空间中，相应的集合称为单位球面，每个非零向量都可以缩放至其上。<sup>[10](https://people.cas.uab.edu/~mosya/teaching/631.pdf)</sup>

## 归一化

将非零向量除以其自身的范数，便得到指向同一方向的单位向量：

\[ \mathbf{u} = \frac{1}{\|\mathbf{v}\|}\,\mathbf{v}. \]

结果具有范数1，因为对任意标量 \( c \) 有 \( \|c\,\mathbf{v}\| = |c|\,\|\mathbf{v}\| \)，所以因子 \( 1/\|\mathbf{v}\| \) 恰好抵消了长度。<sup>[3](https://pressbooks.cuny.edu/mat5600linearalgebra/chapter/chapter-2/)</sup> 这一操作称为向量的归一化，它是以 \( \mathbf{v} \) 的正倍数方式获得单位向量的唯一途径。<sup>[6](https://ximera.osu.edu/oerlinalg/LinearAlgebra/VSP-0070/main)</sup> 例如，向量 \( (2, -3, 1, 0, 1) \) 的范数为 \( \sqrt{15} \)，因此沿其方向的单位向量是 \( (2/\sqrt{15}, -3/\sqrt{15}, 1/\sqrt{15}, 0, 1/\sqrt{15}) \)。<sup>[11](https://mathbooks.unl.edu/LinearAlgebra/Section-Introduction-to-Vectors.html)</sup>

零向量是唯一无法归一化的情形：其范数为零，因此除法未定义，对数组进行归一化的数值代码必须显式检查这种情况。<sup>[5](https://codemia.io/knowledge-hub/path/how_to_normalize_a_numpy_array_to_a_unit_vector)</sup>

## 笛卡尔单位向量与分量

在固定的笛卡尔坐标系中，标准单位向量 \( \mathbf{i} \)、\( \mathbf{j} \) 和 \( \mathbf{k} \) 分别指向 x、y、z 轴的正方向。<sup>[2](https://www.sciencedirect.com/topics/mathematics/unit-vector)</sup> 在二维情形下，对应的一对是 \( \hat{\mathbf{i}} = \langle 1, 0 \rangle \) 和 \( \hat{\mathbf{j}} = \langle 0, 1 \rangle \)。<sup>[4](https://odp.library.tamu.edu/math150-2nd-ed/chapter/9-1-vectors/)</sup> 将向量写成这些单位向量的标量倍数之和，便分离出了它的各分量：用标量乘以 \( \mathbf{i} \) 得到沿 x 轴具有该大小的向量，而此类项之和重构出完整的向量。这一方案之所以有效，是因为垂直分量彼此独立作用，一个分量的改变不影响其他分量。<sup>[12](https://www.open.edu/openlearn/science-maths-technology/introducing-vectors-engineering-applications/content-section-3.2)</sup>

物理学和工程学频繁使用这种记号。二维力写作 \( \overrightarrow{F} = a\,\hat{\mathbf{i}} + b\,\hat{\mathbf{j}} \)，三维力写作 \( \overrightarrow{F} = F_x\,\hat{\mathbf{i}} + F_y\,\hat{\mathbf{j}} + F_z\,\hat{\mathbf{k}} \)，其中单位向量指示各轴的方向。<sup>[13](https://openstax.org/books/university-physics-volume-1/pages/5-1-forces)</sup> 当大小为 \( F \) 的力沿两个已知点之间的直线作用时，标准做法是构造两点之间的位置向量，将其归一化得到沿该直线的单位向量，再把力写成大小乘以该单位向量；这样便将笛卡尔形式所合并的大小与方向分离开来。<sup>[14](https://www.ae.msstate.edu/vlsm/forcesys/force_reps/unit_vector.htm)</sup>

单位向量也出现在夹角公式中。对于非零向量 \( \mathbf{x} \) 和 \( \mathbf{y} \)，设它们之间的夹角为 \( \theta \)，则

\[ \cos\theta = \frac{\mathbf{x} \cdot \mathbf{y}}{\|\mathbf{x}\|\,\|\mathbf{y}\|}, \]

因此夹角的余弦恰好是两个归一化向量的点积。<sup>[1](https://secure.maths.usyd.edu.au/u/daners/publ/vector-calculus/chapter-vectors-5.html)</sup>

## 历史渊源

将向量分解为长度与纯方向的思想可追溯到威廉·罗恩·哈密顿（William Rowan Hamilton）的四元数。在其1853年的《四元数讲义》（*Lectures on Quaternions*）中，哈密顿将向量除以其自身长度（他称之为“张量”）的商定义为标记直线方向的“向量单位”，并将这个商命名为向量的旋量（versor）。<sup>[15](https://www.pwein.at/physics/Preprint/Hamilton.pdf)</sup> 他的体系将三个互相垂直的单位向量 \( \mathbf{i} \)、\( \mathbf{j} \)、\( \mathbf{k} \) 视为基本算子，它们正是今天所用笛卡尔单位向量的直接前身。<sup>[16](https://web.mit.edu/axiom-math_v8.14/arch/amd64_ubuntu1404/mnt/ubuntu64/doc/bookvol10.1.pdf)</sup> 现代向量分析——其中单位向量作为独立对象存在——由乔赛亚·威拉德·吉布斯（Josiah Willard Gibbs）和奥利弗·亥维赛（Oliver Heaviside）于19世纪80年代建立，他们将四元数的标量部分和向量部分分离，并视之为独立实体。<sup>[17](https://www.nationalacademies.org/read/11540/chapter/13)</sup>

## 计算与数值实践

归一化一个向量需要计算其欧几里得（L2）范数，而精确地做到这一点是一个实实在在的数值问题。平方和的平方根容易出现上溢和下溢：对非常大的分量求平方，即使最终的范数可以表示，也可能上溢；对非常小的分量求平方则可能下溢为零。标准的一级 BLAS 例程 `dnrm2` 通过谨慎的缩放来计算 L2 范数，而爱德华·安德森（Edward Anderson）的算法978（《ACM数学软件汇刊》，2018年）重新实现了向量2-范数和吉文斯旋转的生成，以在极端值下同时提升性能和稳健性。<sup>[18](https://www.researchgate.net/publication/318666537_Algorithm_978_Safe_scaling_in_the_level_1_BLAS)</sup> LAPACK 的辅助例程 `xLASSQ` 使用分别针对大、小和中等分量的独立累加器来维护缩放后的平方和，以避免同样的失效模式。<sup>[19](https://www.netlib.org/lapack/explore-html/db/d2e/dlassq_8f90_source.html)</sup>

高层库直接提供归一化功能。NumPy 的 `numpy.linalg.norm` 默认返回2-范数，并通过 `ord` 参数支持其他阶数，因此一行除以范数的代码就能产生单位向量。<sup>[7](https://numpy.org/doc/2.0/reference/generated/numpy.linalg.norm.html)</sup> scikit-learn 的 `preprocessing.normalize` 将每个输入向量单独缩放为单位范数，默认 `norm='l2'`，也可选 `'l1'` 和 `'max'`，并通过 `axis` 参数按行或按列操作。<sup>[8](https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.normalize.html)</sup> 在机器学习、信号处理和图形学中，L2 归一化到单位长度被描述为标准预处理步骤。<sup>[5](https://codemia.io/knowledge-hub/path/how_to_normalize_a_numpy_array_to_a_unit_vector)</sup>

## References

1. [Scalar Product and Norm, Vector Calculus notes, University of Sydney](https://secure.maths.usyd.edu.au/u/daners/publ/vector-calculus/chapter-vectors-5.html)
2. [Unit Vector, ScienceDirect Topics](https://www.sciencedirect.com/topics/mathematics/unit-vector)
3. [Vectors in Real n-Space, Linear Algebra Lecture Notes, CUNY Pressbooks](https://pressbooks.cuny.edu/mat5600linearalgebra/chapter/chapter-2/)
4. [9.1 Vectors, Functions, Trigonometry, and Systems of Equations, Texas A&M University](https://odp.library.tamu.edu/math150-2nd-ed/chapter/9-1-vectors/)
5. [How to normalize a numpy array to a unit vector, Codemia](https://codemia.io/knowledge-hub/path/how_to_normalize_a_numpy_array_to_a_unit_vector)
6. [Inner Product Spaces, Ximera (OSU Open Linear Algebra)](https://ximera.osu.edu/oerlinalg/LinearAlgebra/VSP-0070/main)
7. [numpy.linalg.norm, NumPy v2.0 Manual](https://numpy.org/doc/2.0/reference/generated/numpy.linalg.norm.html)
8. [sklearn.preprocessing.normalize, scikit-learn documentation](https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.normalize.html)
9. [Norm and inner product spaces, lecture notes, HKUST](https://www.math.hkust.edu.hk/~mabfchen/Math111/Week13-14.pdf)
10. [Unit sphere and unit ball definitions, University of Alabama at Birmingham](https://people.cas.uab.edu/~mosya/teaching/631.pdf)
11. [Introduction to Vectors, Linear Algebra, University of Nebraska-Lincoln](https://mathbooks.unl.edu/LinearAlgebra/Section-Introduction-to-Vectors.html)
12. [2.2 Cartesian unit vectors, Introducing vectors for engineering applications, Open University](https://www.open.edu/openlearn/science-maths-technology/introducing-vectors-engineering-applications/content-section-3.2)
13. [5.1 Forces, University Physics Volume 1, OpenStax](https://openstax.org/books/university-physics-volume-1/pages/5-1-forces)
14. [Force Representations: Application of the Unit Vector, Mississippi State University](https://www.ae.msstate.edu/vlsm/forcesys/force_reps/unit_vector.htm)
15. [Hamilton's quaternions: tensor and versor notation (transcription of Hamilton's works)](https://www.pwein.at/physics/Preprint/Hamilton.pdf)
16. [The 30 Year Horizon (Axiom volume), quaternion calculus chapter, MIT](https://web.mit.edu/axiom-math_v8.14/arch/amd64_ubuntu1404/mnt/ubuntu64/doc/bookvol10.1.pdf)
17. [Unknown Quantity: A Real and Imaginary History of Algebra, National Academies Press](https://www.nationalacademies.org/read/11540/chapter/13)
18. [Edward Anderson (2018). Algorithm 978: Safe Scaling in the Level 1 BLAS. ACM Transactions on Mathematical Software 44(1).](https://www.researchgate.net/publication/318666537_Algorithm_978_Safe_scaling_in_the_level_1_BLAS)
19. [LAPACK dlassq.f90 source, Netlib](https://www.netlib.org/lapack/explore-html/db/d2e/dlassq_8f90_source.html)

---
*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/unit-vector

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