Training Linear Algebra Vectors and Dot Products
4 / 5

Vectors and Dot Products

24 min Linear Algebra

Vectors and Dot Products

Vectors are the geometric counterpart to matrices. While a matrix stores an entire transformation or data table, a vector represents a single quantity that has both magnitude (how large) and direction (which way). Forces, velocities, displacements, and electric fields are all naturally described by vectors, and the ability to add them, scale them, and measure angles between them is fundamental to physics, engineering, computer graphics, and machine learning.

In coordinates, a 2-D vector $\langle a,b \rangle$ is just an ordered pair, and a 3-D vector $\langle a,b,c \rangle$ is an ordered triple. You add vectors component-by-component and multiply by a scalar component-by-component — operations that are almost trivially simple yet immensely powerful. The magnitude of a vector is its length, computed by the Pythagorean theorem: $\|\mathbf{v}\| = \sqrt{a^2 + b^2}$.

The dot product (or scalar product) takes two vectors and returns a single number: $\mathbf{u} \cdot \mathbf{v} = u_1 v_1 + u_2 v_2$. This number carries geometric meaning — it is related to the cosine of the angle between the two vectors. When the dot product is zero, the vectors are perpendicular (orthogonal), a property that appears constantly in projections, least-squares fitting, and Fourier analysis.

In this lesson you will practice vector addition, scalar multiplication, magnitude calculation, and dot-product computation. The interactive tool lets you adjust two vectors and immediately see their sum, individual magnitudes, dot product, and the angle between them, all rendered on a canvas so you can build geometric intuition alongside algebraic skill.

Basic Operations

Add vectors component-wise and multiply by scalars component-wise.

Example 1

Add $\langle 2,-1 \rangle + \langle 4,3 \rangle$.

  1. $\langle 6,2 \rangle$.
Magnitude

$$\|\mathbf{v}\|=\sqrt{a^2+b^2}$$ in 2D.

Example 2

Find the magnitude of $\langle 3,4 \rangle$.

  1. $5$.
Dot Product

$$\mathbf{u}\cdot\mathbf{v}=u_1v_1+u_2v_2$$

If the dot product is $0$, the vectors are perpendicular.

Example 3

Compute $\langle 1,2 \rangle\cdot\langle 3,4 \rangle$.

  1. $1(3)+2(4)=11$.
Interactive Explorer: Vectors & Dot Product
u + v = ⟨6, 2⟩
‖u‖ = 2.236
‖v‖ = 5.000
u · v = 5
Angle = 63.4°
Perpendicular? No

Practice Problems

1. Add $\langle 1,5 \rangle$ and $\langle -2,4 \rangle$.
2. Find the magnitude of $\langle 6,8 \rangle$.
3. Compute $\langle 2,1 \rangle\cdot\langle 5,-3 \rangle$.
4. What does a dot product of zero mean?
5. Multiply $2\langle 3,-1 \rangle$.
Show Answer Key

1. $\langle -1,9 \rangle$

2. $10$

3. $7$

4. The vectors are perpendicular

5. $\langle 6,-2 \rangle$