Intermediate

向量夹角计算器

输入两个等长向量的分量,以度数和弧度求它们之间的夹角。
Comma or space separated
Must have the same length as a
Angle between vectors
45°

Computed from the dot product formula

abVector directions (first two components) — angle between them
Angle (radians)
0.7854
cos θ
0.7071
Dot product a·b
1
Magnitude |a|
1
Magnitude |b|
1.4142
Step by step
  1. 1

    Dot product a·b

    1×1 + 0×1 + 0×0 = 1
  2. 2

    Magnitude |a|

    √(1² + 0² + 0²) = 1
  3. 3

    Magnitude |b|

    √(1² + 1² + 0²) = 1.4142
  4. 4

    cos θ = a·b ÷ (|a| × |b|)

    1 ÷ (1 × 1.4142) = 0.7071
  5. 5

    Angle θ = arccos(cos θ) × 180 ÷ π

    arccos(0.7071) × 180 ÷ π = 45
结果仅为一般参考性的估算,并非专业建议——在依赖这些重要结果之前,请务必自行独立核实。 阅读完整免责声明.
快速解答

这个计算器是如何工作的?

求两向量夹角时,先计算点积再除以两向量模的乘积得到 cos θ,然后取反余弦。结果在 0° 至 180° 之间,可反映向量是同向(0°)、垂直(90°)还是反向(180°)。

公式
cos θ = (a·b) / (|a| × |b|), θ = arccos(cos θ)
How this is calculated

以逗号或空格分隔的数字列表分别输入向量 a 和 b。两向量的分量个数(维度)必须相同,且都不能是零向量,因为模为零时夹角无意义。

计算器首先计算点积 a·b = Σ aᵢbᵢ 以及各向量的模 |a| = √(Σ aᵢ²) 和 |b| = √(Σ bᵢ²)。夹角余弦值为 cos θ = (a·b) / (|a| × |b|)。从数学上讲,该值在 [-1, 1] 范围内,但浮点舍入可能使其略微超出此范围,因此在取反余弦之前会将其截断至 [-1, 1]。

最终 θ = arccos(cos θ) 给出弧度制下的角度,再用 θ° = θ × 180 / π 换算为度数。结果始终在 0° 至 180° 之间:0° 表示两向量同向,90° 表示垂直(正交),180° 表示反向。

常见问题

点积仅对等维向量有定义,因此两向量必须有相同数量的分量。若维度不同,计算器无法计算夹角。

反余弦函数的值域为 0 至 π 弧度(0° 至 180°),这表示两向量之间最小的无方向夹角,与它们在空间中的朝向无关。

90° 表示点积为零,即两向量正交(垂直)。

也称为

向量夹角
两向量夹角
求向量夹角
点积夹角
向量角度
夹角公式
矢量夹角

APA

TG we-Calculate Editorial Team. (2026). 向量夹角计算器 [Online calculator]. TG we-Calculate. https://we-calculate.com/zh/calculator/angle-between-vectors-calculator

Chicago

TG we-Calculate Editorial Team. "向量夹角计算器." TG we-Calculate. 2026. https://we-calculate.com/zh/calculator/angle-between-vectors-calculator.

IEEE

TG we-Calculate Editorial Team, "向量夹角计算器," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/zh/calculator/angle-between-vectors-calculator

BibTeX

@misc{wecalculate_angle_between_vectors_calculator, title = {向量夹角计算器}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/zh/calculator/angle-between-vectors-calculator}}, year = {2026}, note = {TG we-Calculate} }

这个计算器对您有帮助吗?