Linear algebra part 2 - Plotting vectors

Plotting vectors on a graph is the best way to gain an intuative understanding of what they represent. Each axis of a graph allows us to show the magnitude (size) of one dimension. Stepping back from vectors for a minute, a simple number line allows you to show the size of a single number, one dimension. If we want to show the size of two numbers, a two-dimensional vector, we need two number lines, the x and y axis of a graph.

As an example let us define a two-dimensional vector, v\mathbf{v}, and plot it on a graph. When we plot vectors the first component is plotted on the x-axis and the second component is plotted on the y-axis. The vector is shown as a straight line from (0,0)(0, 0) to this point.

v=[34]\mathbf{v} = \begin{bmatrix} 3 \\ 4 \end{bmatrix}

Plotting vectors on a graph allows us to visualise adding and subtracting vectors. For example, we can define w\mathbf{w} and then calculate v+w\mathbf{v} + \mathbf{w}.

w=[13] \mathbf{w} = \begin{bmatrix} -1 \\ 3 \end{bmatrix}
v+w=[3+(1)4+7]=[27] \mathbf{v} + \mathbf{w} = \left[ \begin{array}{ccc} 3 & + & (-1) \\ 4 & + & 7 \end{array} \right] = \begin{bmatrix} 2 \\ 7 \end{bmatrix}

The vector v+w\mathbf{v} + \mathbf{w} is the diagonal of the parallelogram formed by the vectors v\mathbf{v} and w\mathbf{w}, that shares the same inital point as the two vectors (in this case (0,0)(0, 0)). This is known as the parallelogram law of vector addition.

We see a similar picture when subtracting vectors. The vector vw\mathbf{v} - \mathbf{w} is the diagonal of the parallelogram formed by the vectors v\mathbf{v} and w-\mathbf{w} that shares the same inital point as the two vectors (in this case (0,0)(0, 0)).

vw=[3(1)47]=[41] \mathbf{v} - \mathbf{w} = \left[ \begin{array}{ccc} 3 & - & (-1) \\ 4 & - & 7 \end{array} \right] = \begin{bmatrix} 4 \\ 1 \end{bmatrix}

Plotting vectors in three dimensions

Plotting a three dimensional vector requires three axes. The third component of the vector is plotted on the z-axis. We can define a three-dimensional vector, v\mathbf{v}, and plot it and an x, y and z axis.

v=[342]\mathbf{v} = \begin{bmatrix} 3 \\ 4 \\ 2 \end{bmatrix}

Adding and subtracting vectors in three dimensions works in the same way as two dimensions. For example, we can define a second vector, w\mathbf{w}, and calculate v+w\mathbf{v} + \mathbf{w}.

w=[311]\mathbf{w} = \begin{bmatrix} 3 \\ 1 \\ 1 \end{bmatrix}
v+w=[3+34+12+1]=[653] \mathbf{v} + \mathbf{w} = \begin{bmatrix} 3 + 3 \\ 4 + 1 \\ 2 + 1 \end{bmatrix} = \begin{bmatrix} 6 \\ 5 \\ 3 \end{bmatrix}

Problems

If you can solve these problems you have understood how to plot vectors. The following questions can all be answered on the same x and y axis.

  1. Plot the vectors v\mathbf{v} and w\mathbf{w} on the graph, where:
v=[23],w=[31] \mathbf{v} = \begin{bmatrix} 2 \\ 3 \end{bmatrix}, \quad \mathbf{w} = \begin{bmatrix} 3 \\ -1 \end{bmatrix}
  1. Plot v+w\mathbf{v} + \mathbf{w}.

  2. Plot vw\mathbf{v} - \mathbf{w}.

Solutions

Subscribe to 15 Minute Finance

Be the first to know when new posts are published

Buy me a coffee

If you have learnt something today, please consider supporting me