freeCodeCamp/guide/chinese/mathematics/vectors/addition-and-scalar-multipl.../index.md

42 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
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 + - 10 + - 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>
#### 更多信息: