42 lines
1.6 KiB
Markdown
42 lines
1.6 KiB
Markdown
---
|
||
title: Addition and Scalar Multiplication
|
||
localeTitle: 加法和标量乘法
|
||
---
|
||
## 加法和标量乘法
|
||
|
||
使用向量时,两个最常见的操作是向量的加法和标量的乘法。
|
||
|
||
### 矢量加法
|
||
|
||
矢量添加可以如下可视化:
|
||
|
||
1. 取第二个矢量的“尾部”(没有箭头的末端/矢量的原点),并将其(未改变)连接到第一个矢量的“尖端”(尖头/箭头末端)。现在,如果你创建一个从第一个向量的尾部到第二个向量的尖端的新向量,你将留下两个向量的总和!
|
||
|
||
2. 减去两个向量几乎是相同的。但是,您必须翻转第二个矢量的方向,然后继续将其连接到第一个矢量。
|
||
|
||
|
||
显然,您不希望每次想要添加矢量时都必须绘制和连接矢量。幸运的是,解决方案在实践中更加简单。
|
||
|
||
假设你有两个向量<1,2>和<5,-4>,你所要做的就是添加相应的组件:
|
||
|
||
<1,2> + <5,-4> = <1 + 5,2 +( - 4)> = <6,-2>
|
||
|
||
只要添加的两个矢量的大小相同,这适用于任意多个维度的矢量。例如,添加<4,4,-5,0>和<2,4,-1,-29>:
|
||
|
||
<4,4,-5,0> + <2,4,-1,-29> = <4 + 2,4 + 4,-5 +( - 1),0 +( - 29)> = <6 ,8,-6,-29>
|
||
|
||
### 标量乘法
|
||
|
||
将矢量乘以标量时,您可以将其视为增加其幅度。
|
||
|
||
例如,将vector <2,3>乘以2时:
|
||
|
||
2 \* <2,3> = <2 \* 2,2 \* 3> = <4,6>
|
||
|
||
方向得以保留 - 只是幅度增加了2倍。
|
||
|
||
但是,当我们乘以负数时,方向相反。将vector <2,3>乘以-2时:
|
||
|
||
-2 \* <2,3> = < - 2 \* 2, - 2 \* 3> = < - 4,-6>
|
||
|
||
#### 更多信息: |