Skip to content

Vectors in 2D

Work through these tutorials after watching the Vectors in 2D videos. Each subsection walks through the main ideas step by step with worked examples. The exercises on the topic page use different problems — they are not copies of the tutorial or video examples.

1. Vectors in 2D

A vector has both magnitude (length) and direction. A scalar has only a value (no direction).

Vector Scalar
Has direction? Yes No
Examples velocity, force, displacement speed, mass, temperature

Vectors are drawn as arrows. We write \(\vec{a}\) (arrow over the letter) to show it is a vector, or use bold \(\mathbf{a}\) in printed text. Sometimes a bar, \(\bar{a}\), is used instead, but the arrow \(\vec{a}\) is the standard notation for vectors. Here we use \(\mathbf{a}\) for vectors.

Component form

A 2D vector is written as a column vector:

\[\mathbf{a} = \begin{pmatrix} a_1 \\ a_2 \end{pmatrix}\]

where \(a_1\) is the horizontal component (top entry) and \(a_2\) is the vertical component (bottom entry).

Worked example: Draw \(\mathbf{a} = \begin{pmatrix} -1 \\ 3 \end{pmatrix}\).

Vector a with components -1 and 3 from the origin

From the origin: one step left (\(-1\)), then three steps up (\(3\)). The dashed lines show the horizontal and vertical components. The same vector can be drawn anywhere — only magnitude and direction matter.

Scaling

Multiply each component by the scalar \(c\):

\[c\mathbf{a} = \begin{pmatrix} ca_1 \\ ca_2 \end{pmatrix}\]
  • \(c > 1\) stretches the vector
  • \(0 < c < 1\) shortens it
  • \(c = -1\) reverses direction (\(-\mathbf{a}\))

Worked example: If \(\mathbf{a} = \begin{pmatrix} -1 \\ 3 \end{pmatrix}\), find \(3\mathbf{a}\) and \(-\mathbf{a}\).

\[3\mathbf{a} = \begin{pmatrix} -3 \\ 9 \end{pmatrix}, \qquad -\mathbf{a} = \begin{pmatrix} 1 \\ -3 \end{pmatrix}\]

Addition and subtraction

Add or subtract component by component:

\[\mathbf{a} + \mathbf{b} = \begin{pmatrix} a_1 + b_1 \\ a_2 + b_2 \end{pmatrix}\]
\[\mathbf{a} - \mathbf{b} = \begin{pmatrix} a_1 - b_1 \\ a_2 - b_2 \end{pmatrix}\]

Geometrically, place vectors tip-to-tail (or use the parallelogram rule). Note that \(\mathbf{a} - \mathbf{b} = \mathbf{a} + (-\mathbf{b})\).

Worked example: With \(\mathbf{a} = \begin{pmatrix} -1 \\ 3 \end{pmatrix}\) and \(\mathbf{b} = \begin{pmatrix} 4 \\ 3 \end{pmatrix}\):

\[\mathbf{a} + \mathbf{b} = \begin{pmatrix} 3 \\ 6 \end{pmatrix}, \qquad \mathbf{a} - \mathbf{b} = \begin{pmatrix} -5 \\ 0 \end{pmatrix}\]
Check your understanding

Try Exercise 1 and Exercise 7 on the topic page.

2. Dot product

The dot product (also called scalar product) of \(\mathbf{a} = \begin{pmatrix} a_1 \\ a_2 \end{pmatrix}\) and \(\mathbf{b} = \begin{pmatrix} b_1 \\ b_2 \end{pmatrix}\) is:

\[\mathbf{a} \cdot \mathbf{b} = a_1 b_1 + a_2 b_2\]

The result is a scalar, not a vector.

Worked example: For \(\mathbf{a} = \begin{pmatrix} -3 \\ 4 \end{pmatrix}\) and \(\mathbf{b} = \begin{pmatrix} 1 \\ 2 \end{pmatrix}\):

\[\mathbf{a} \cdot \mathbf{b} = (-3)(1) + (4)(2) = -3 + 8 = 5\]

Length of a vector

\[|\mathbf{a}|^2 = \mathbf{a} \cdot \mathbf{a} = a_1^2 + a_2^2, \qquad |\mathbf{a}| = \sqrt{a_1^2 + a_2^2}\]

This is the Pythagorean theorem applied to the components.

Worked example: For \(\mathbf{a} = \begin{pmatrix} -3 \\ 4 \end{pmatrix}\):

\[|\mathbf{a}| = \sqrt{(-3)^2 + 4^2} = \sqrt{9 + 16} = 5\]

Angle between vectors

\[\mathbf{a} \cdot \mathbf{b} = |\mathbf{a}|\,|\mathbf{b}|\cos\theta\]

So (when both vectors are nonzero):

\[\cos\theta = \frac{\mathbf{a} \cdot \mathbf{b}}{|\mathbf{a}|\,|\mathbf{b}|}\]

Worked example — perpendicular vectors: For \(\mathbf{a} = \begin{pmatrix} 6 \\ -2 \end{pmatrix}\) and \(\mathbf{b} = \begin{pmatrix} \dfrac{1}{3} \\ 1 \end{pmatrix}\):

\[\mathbf{a} \cdot \mathbf{b} = 6 \cdot \frac{1}{3} + (-2)(1) = 2 - 2 = 0\]

So \(\cos\theta = 0\) and \(\theta = 90°\). The vectors are orthogonal (perpendicular). We write \(\mathbf{a} \perp \mathbf{b}\).

Projection

The projection of \(\mathbf{a}\) onto \(\mathbf{b}\) is the component of \(\mathbf{a}\) in the direction of \(\mathbf{b}\):

\[\text{proj}_{\mathbf{b}}(\mathbf{a}) = \frac{\mathbf{a} \cdot \mathbf{b}}{|\mathbf{b}|^2}\,\mathbf{b}\]

Worked example: For \(\mathbf{a} = \begin{pmatrix} 2 \\ 8 \end{pmatrix}\) and \(\mathbf{b} = \begin{pmatrix} 8 \\ 2 \end{pmatrix}\):

\[\mathbf{a} \cdot \mathbf{b} = 16 + 16 = 32, \qquad |\mathbf{b}|^2 = 64 + 4 = 68\]
\[\text{proj}_{\mathbf{b}}(\mathbf{a}) = \frac{32}{68}\,\mathbf{b} = \frac{8}{17}\,\mathbf{b}\]
Check your understanding

Try Exercises 2, 3, 4, and 5 on the topic page.

3. Parametric equation of a line

A point \(P_0\) with position vector \(\mathbf{r}_0\) and a direction vector \(\mathbf{d}\) determine a line. The parameter \(t\) controls how far we move along \(\mathbf{d}\):

\[\mathbf{r} = \mathbf{r}_0 + t\mathbf{d}\]

As \(t\) ranges over all real numbers, \(\mathbf{r}\) traces every point on the line.

In components, with \(\mathbf{r}_0 = \begin{pmatrix} x_0 \\ y_0 \end{pmatrix}\) and \(\mathbf{d} = \begin{pmatrix} d_1 \\ d_2 \end{pmatrix}\):

\[x = x_0 + t d_1, \qquad y = y_0 + t d_2\]

The same line can be described in many ways (different starting points or direction vectors).

Worked example: A line through \(\begin{pmatrix} 3 \\ 0 \end{pmatrix}\) with direction \(\begin{pmatrix} 3 \\ 2 \end{pmatrix}\):

\[\mathbf{r} = \begin{pmatrix} 3 \\ 0 \end{pmatrix} + t\begin{pmatrix} 3 \\ 2 \end{pmatrix}\]

When \(t = 10\):

\[\mathbf{r} = \begin{pmatrix} 3 + 30 \\ 0 + 20 \end{pmatrix} = \begin{pmatrix} 33 \\ 20 \end{pmatrix}\]

Worked example — parallel line: Through \(\begin{pmatrix} 2 \\ 4 \end{pmatrix}\) with the same direction \(\begin{pmatrix} 3 \\ 2 \end{pmatrix}\):

\[\mathbf{r} = \begin{pmatrix} 2 \\ 4 \end{pmatrix} + t\begin{pmatrix} 3 \\ 2 \end{pmatrix}\]

Worked example — orthogonal line: A direction vector orthogonal to \(\begin{pmatrix} 3 \\ 2 \end{pmatrix}\) satisfies \(3d_1 + 2d_2 = 0\). One choice is \(\mathbf{d} = \begin{pmatrix} -2 \\ 3 \end{pmatrix}\). A line through \(\begin{pmatrix} 3 \\ 0 \end{pmatrix}\):

\[\mathbf{r} = \begin{pmatrix} 3 \\ 0 \end{pmatrix} + t\begin{pmatrix} -2 \\ 3 \end{pmatrix}\]
Check your understanding

Try Exercises 8, 9, and 10 on the topic page.