1. What is a VECTOR
A ‘vector’ is a mathematical object which has a magnitude and a direction whereas the ‘scalar’ only shows a magnitude. we mostly draw vectors in shape of arrows where its length is proportional to its size(magnitude).
The direction of an arrow heading is the same where the vector is pointing out.
2. Vector Arithmetic
The rules for addition(plus) and subtraction(minus) are applied differently on vectors and scalars. While scalars follow the ordinary principles we’ve learned such as 1+5 =6, 4 -2=2, vectors don’t since each vector has not only a magnitude but also a direction.
2.1 Add vectors
Let’s say there are three example vectors called vector 1, 2, and 3 as is shown in figure 2.
Given two vectors 1 and 2, we want to form the sum of those vectors which is vector 3. In order to perform the addition of vectors, Firstly we need to choose either vector 1 or 2. Then translate one’s tail until it coincides with the other one’s head. A directed line from the tail of chosen vector in the first step to the head of the other vector is the sum of those two vectors.
For example, I chose the vector 1 to translate in Figure 3. After moving it parallel until the vector 2’s head, we can see the straight line from vector 2’s tail to translated vector 1’s head actually coincide with vector 3.
Addition of vectors has two traits.
(1) The Commutative Law
The law states that the sum of vectors remains the same regardless of their order in addition.
(2) The Associative Law
It states that the result of adding three different vectors does not change depending on which pair of a vector is added first.
2.2 Subtraction of Vectors
Subtracting vector is interpretable as an addition of the opposite vector, since the vector -a is the opposite of vector a which means that simply the vector -a has the same magnitude but an opposite direction of vector a.
Thus, vector A subtracted by vector B is identical to the Addition of vector A and the opposite of B.
Again, given the three vectors in Figure 7, we can form vector 3 by subtracting vector 2 from vector 1.
By applying the above rule, we know that vec_1 — vec_2 = vec_1 + (-vec_2). Since -vec_2 is the opposite of vec_2 as is shown in Figure 8, what is left to calculate the subtraction of vector is applying ‘Head to Tail Method’ as we did at vector addition. Translate vec_1 until its tail coincides with the head of -vec_2 and plot a directed line from -vec_2’s tail to vec_1’s head then that vector is equivalent to vec_3.
3. Codes
Python codes I used for visualizing vectors are as below.
4. Reference
[1] https://simple.m.wikipedia.org/wiki/Vector
[2] https://mathinsight.org/vector_introduction
[3] https://stackoverflow.com/questions/42281966/how-to-plot-vectors-in-python-using-matplotlib