freeCodeCamp/guide/english/mathematics/adding-and-subtracting-vectors/index.md

18 lines
1008 B
Markdown
Raw Normal View History

2018-10-12 19:37:13 +00:00
---
title: Adding and Subtracting Vectors
---
## Adding and Subtracting Vectors
In linear algebra, the sum A+B of two vectors (A and B) is equivalent to the sum of the corresponding components of A and B. For instance, if Vector A is `{1, 3, 4}` and Vector B is `{2, 5, 9}`, the sum A+B is `{1+2, 3+5, 4+9} = {3, 8, 13}`.
![A visualization of vector addition.](http://mathworld.wolfram.com/images/eps-gif/ParallelogramLaw_1000.gif)<sup>1</sup>
Similarly, the difference A-B between two vectors (again, A and B) is equal to the difference between the corresponding components of A and B. The difference A-B with the above vectors is `{1-2, 3-5, 4-9} = {-1, -2, -5}`.
#### More Information:
[Vector Addition on Wolfram Mathworld](http://mathworld.wolfram.com/VectorAddition.html)
[Vector Addition and Subtraction on Wikipedia](https://en.wikipedia.org/wiki/Euclidean_vector#Addition_and_subtraction)
### Sources:
1. [Vector Addition on Wolfram Mathworld](http://mathworld.wolfram.com/VectorAddition.html)