Introduction to Vectors

Published

A vector is a line that goes from one point to another. Vectors can exist in any dimension, so you can have a 2, 3, ..., n th dimension vector even if you can't draw or imagine a line in that dimension.

All vectors have a length (magnitude) and a direction.

A vector is usually denoted by an upper-case letter with a right-arrow over top.

Magnitude:

To find the length (magnitude) of a vector, you need to square each element and add them together. Once you've done that, the length is the square root of the resulting value. The magnitude is usually denoted by a set of double-line brackets on either side of the vector.

Example:

\overrightarrow{V} = \begin{bmatrix} 1\\ 2\\ 3 \end{bmatrix} \\ \left\|\overrightarrow{V}\right\| = \sqrt[]{(1^2 + 2^2 + 3^2)} = \sqrt[]{14}

Standard Basis Vectors:

There is a special type of vector that, using scalar multiplication, any vector can be made from. These vectors are usually lettered i, j, k, etc... depending on which dimension you're working with. As you can see in the examples below, for each dimension you add another vector that represents a single element. By multiplying each vector by a scalar and then adding the vectors together, you can end up with any vector just as I've done in the fourth example.

Example - First Dimension:

i = \begin{bmatrix} 1 \end{bmatrix}

Example - Second Dimension:

i = \begin{bmatrix} 1 \\ 0 \end{bmatrix} j = \begin{bmatrix} 0 \\ 1 \end{bmatrix}

Example - Third Dimension:

i = \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix} j = \begin{bmatrix} 0 \\ 1 \\ 0 \end{bmatrix} k = \begin{bmatrix} 0\\ 0\\ 1 \end{bmatrix}

Example - Making a Vector:

2i + 3j + 4k = 2 \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix} + 3\begin{bmatrix} 0 \\ 1 \\ 0 \end{bmatrix} + 4\begin{bmatrix} 0\\ 0\\ 1 \end{bmatrix} = \begin{bmatrix} 2 \\ 0 \\ 0 \end{bmatrix} + \begin{bmatrix} 0 \\ 3 \\ 0 \end{bmatrix} + \begin{bmatrix} 0\\ 0\\ 4 \end{bmatrix} = \begin{bmatrix} 2\\ 3\\ 4 \end{bmatrix}

Linear Combinations of Vectors

:

A linear combination of two or more vectors is the vector obtained by adding two or more vectors by adding two or more vectors (with different directions) which are multiplied by scalar values. (Citation)

Example:

\large \large The~vector~\overrightarrow{a}~can~be~created~by~multiplying~the~following~three\\ vectors~by~three~scalars~and~then~adding~the~results.\\\\ ~~~~~~~~~~~~~~~~~~~~~~~~~~~\overrightarrow{a} = x\overrightarrow{b} + y\overrightarrow{c} + z\overrightarrow{d} \\\\ \begin{bmatrix} 10\\ 10\\ 2 \end{bmatrix} = x \begin{bmatrix} 1\\ 1\\ 0 \end{bmatrix} + y\begin{bmatrix} 0\\ 5\\ 1 \end{bmatrix} + z \begin{bmatrix} 2\\ 0\\ 0 \end{bmatrix} \\\\ \begin{bmatrix} 10\\ 10\\ 2 \end{bmatrix} = 0 \begin{bmatrix} 1\\ 1\\ 0 \end{bmatrix} + 2\begin{bmatrix} 0\\ 5\\ 1 \end{bmatrix} + 5 \begin{bmatrix} 2\\ 0\\ 0 \end{bmatrix} \\\\ \begin{bmatrix} 10\\ 10\\ 2 \end{bmatrix} = \begin{bmatrix} 0\\ 10\\ 2 \end{bmatrix} + \begin{bmatrix} 10\\ 0\\ 0 \end{bmatrix} \\\\ \begin{bmatrix} 10\\ 10\\ 2 \end{bmatrix} = \begin{bmatrix} 10\\ 10\\ 2 \end{bmatrix}

Example:

\large The~vector~\overrightarrow{a}~can~be~created~by~multiplying~the~following~three\\ vectors~by~three~scalars~and~then~adding~the~results.\\\\ ~~~~~~~~~~~~~~~~~~~~~~~~~~~\overrightarrow{a} = x\overrightarrow{b} + y\overrightarrow{c} + z\overrightarrow{d} \\\\ \begin{bmatrix} 30.5\\ 35\\ 39.5 \end{bmatrix} = x \begin{bmatrix} 3\\ 4\\ 5 \end{bmatrix} + y\begin{bmatrix} 1\\ 2\\ 3 \end{bmatrix} + z \begin{bmatrix} 6\\ 7\\ 8 \end{bmatrix} \\\\ \begin{bmatrix} 30.5\\ 35\\ 39.5 \end{bmatrix} = 1/2 \begin{bmatrix} 3\\ 4\\ 5 \end{bmatrix} + -1\begin{bmatrix} 1\\ 2\\ 3 \end{bmatrix} + 5 \begin{bmatrix} 6\\ 7\\ 8 \end{bmatrix} \\\\ \begin{bmatrix} 30.5\\ 35\\ 39.5 \end{bmatrix} = \begin{bmatrix} \frac{3}{2}\\ 2\\ \frac{5}{2} \end{bmatrix} - \begin{bmatrix} 1\\ 2\\ 3 \end{bmatrix} + \begin{bmatrix} 30\\ 35\\ 40 \end{bmatrix} \\\\ \begin{bmatrix} 30.5\\ 35\\ 39.5 \end{bmatrix} = \begin{bmatrix} \frac{1}{2}\\ 0\\ -\frac{1}{2} \end{bmatrix} + \begin{bmatrix} 30\\ 35\\ 40 \end{bmatrix}\\\\ \begin{bmatrix} 30.5\\ 35\\ 39.5 \end{bmatrix} = \begin{bmatrix} 30.5\\ 35\\ 39.5 \end{bmatrix}

Angle Between Vectors:

Formula:

\Large\cos{\theta} = \frac{\overrightarrow{U} \cdot \overrightarrow{V}}{\left \| \overrightarrow{U} \right \| \times \left \| \overrightarrow{V} \right \|}

Example:

\overrightarrow{V} = \begin{bmatrix} 1\\ 2 \end{bmatrix} \\ \overrightarrow{U} = \begin{bmatrix} 3\\ 4 \end{bmatrix} \\ \\ Calculate~the~dot-product~of~the~two~vectors:\\ \overrightarrow{U} \cdot \overrightarrow{V} = (1 \times 3) + (2 \times 4) = 3 + 8 = 11 \\ \\ Multiply~both~magnitudes:\\ \left\| \overrightarrow{U} \right \| \times\left\|\overrightarrow{V}\right\| = \sqrt{5} \times \sqrt{25} = \sqrt{5} \times 5 \\ \\ Combine~for~the~angle:\\ \cos{\theta} = \frac{11}{\sqrt{5} \times 5}

Projections:

Projection of a Vector onto a Vector:

Projecting a vector onto another vector gives you the difference in size of the two vectors. The image below is a good representation of what you're calculating.

Formula:

\Large\cos{\theta} = \frac{\overrightarrow{U} \cdot \overrightarrow{V}}{\left \| \overrightarrow{U} \right \| \times \left \| \overrightarrow{V} \right \|}

Example - 2D Vector:

\large Find~the~projection~of~\overrightarrow{b}~onto~\overrightarrow{a}\\\\\overrightarrow{a} = \begin{bmatrix} 1\\ 2 \end{bmatrix} \overrightarrow{b} = \begin{bmatrix} 3\\ 4 \end{bmatrix} \\\\\\ Solve~the~formula~by~doing~each~step:\\ proj_{\overrightarrow{a}}\overrightarrow{b} = \left(\frac{\overrightarrow{b} \cdot \overrightarrow{a}}{\overrightarrow{a} \cdot \overrightarrow{a}} \right ) \times \overrightarrow{a} \\\\\\ \overrightarrow{b} \cdot \overrightarrow{a} = \begin{bmatrix} 1\\ 2 \end{bmatrix} \cdot \begin{bmatrix} 3\\ 4 \end{bmatrix} = (1 \times 3) + (2 \times 4) = 3 + 8 = 11 \\\\\\ \overrightarrow{a} \cdot \overrightarrow{a} = \begin{bmatrix} 1\\ 2 \end{bmatrix} \cdot \begin{bmatrix} 1\\ 2 \end{bmatrix} = (1 \times 1) + (2 \times 2) = 1 + 4 = 5 \\\\\\ proj_{\overrightarrow{a}}\overrightarrow{b} = \left(\frac{32}{14} \right ) \times \overrightarrow{a}\\ ~~~~~~~~~~~~= \left(\frac{11}{5} \right ) \times \begin{bmatrix} 1\\ 2 \end{bmatrix} = \begin{bmatrix} \frac{11}{5}\\\\ \frac{22}{5} \end{bmatrix}

Example - 3D Vector:

\large Find~the~projection~of~\overrightarrow{b}~onto~\overrightarrow{a}\\\\\overrightarrow{a} = \begin{bmatrix} 1\\ 2\\ 3 \end{bmatrix} \overrightarrow{b} = \begin{bmatrix} 4\\ 5\\ 6 \end{bmatrix} \\\\\\ Solve~the~formula~by~doing~each~step:\\ proj_{\overrightarrow{a}}\overrightarrow{b} = \left(\frac{\overrightarrow{b} \cdot \overrightarrow{a}}{\overrightarrow{a} \cdot \overrightarrow{a}} \right ) \times \overrightarrow{a} \\\\\\ \overrightarrow{b} \cdot \overrightarrow{a} = \begin{bmatrix} 1\\ 2\\ 3 \end{bmatrix} \cdot \begin{bmatrix} 4\\ 5\\ 6 \end{bmatrix} = (1 \times 4) + (2 \times 5) + (3 \times 6) = 4 + 10 + 18 = 32 \\\\\\ \overrightarrow{a} \cdot \overrightarrow{a} = \begin{bmatrix} 1\\ 2\\ 3 \end{bmatrix} \cdot \begin{bmatrix} 1\\ 2\\ 3 \end{bmatrix} = (1 \times 1) + (2 \times 2) + (3 \times 3) = 1 + 4 + 9 = 14 \\\\\\ proj_{\overrightarrow{a}}\overrightarrow{b} = \left(\frac{32}{14} \right ) \times \overrightarrow{a}\\ ~~~~~~~~~~~= \left(\frac{32}{14} \right ) \times \begin{bmatrix} 1\\ 2\\ 3 \end{bmatrix} = \begin{bmatrix} \frac{32}{14}\\\\ \frac{64}{14}\\\\ \frac{96}{14} \end{bmatrix}
Special thanks to birling for creating the gif used in the Projections section.