数学

点积与夹角

点积把两个向量合成为一个数。它的符号说明两个向量是同向、反向还是垂直。

5 分钟难度 1/3交互演示区域不展示广告。
u · v0.364Angle85.0°|u|2.20|v|1.90Signed proj.0.19

u · v = (1.99)(-0.65) + (0.93)(1.79) = 0.364

Acute: the vectors point partly in the same direction.

The dot product measures alignment. Its sign tells you whether the angle is acute, right, or obtuse. The cyan arrow is the projection of u onto v; the rose segment shows the perpendicular residual.

你看到的是什么

1

在坐标形式下,u · v = u₁v₁ + u₂v₂,即对应分量相乘后相加。

2

恒等式 u · v = |u||v| cos θ 把点积与两个向量的夹角联系起来。

3

u 在 v 上的投影长度是 (u · v) / |v|。点积为零表示两个向量垂直。

为什么重要

点积用于投影、最小二乘、图形学光照、相似度搜索和正交性的定义。

复杂度与细节

在二维中,两个向量的点积、长度和夹角都只需 O(1) 时间。

常见问题

为什么点积为零表示垂直?+

因为 u · v = |u||v| cos θ。若两个向量都不是零向量,点积为零当且仅当 cos θ = 0,即 θ = 90°。

负点积意味着什么?+

夹角是钝角,两个向量在某种程度上方向相反。正点积表示夹角是锐角。