determin.ant
01-vectors / 1.2

Module 1: Vectors

Vector Addition

Where you'll see this: a drone follows waypoints by adding displacement vectors. A physics engine combines forces (gravity + wind + thrust) with vector addition. In graphics, you move a camera by adding a velocity vector to its position every frame.

In the last lesson you learned that a vector is a displacement — an instruction to move a certain distance in a certain direction. So what happens when you follow two displacements one after another?

The directions analogy

Say you walk 3 blocks east and 1 block north to reach a park. From there, you walk 1 block east and 3 blocks north to reach a café. Where did you end up relative to where you started?

You went 4 blocks east and 4 blocks north in total. That combined journey is the sum of the two vectors.

The tip-to-tail method

Here's the geometric rule: place the tail of the second vector at the tip of the first. The sum is the arrow that goes straight from where you started to where you ended up.

In the interactive, the faint blue and pink arrows show this — each vector is drawn again starting from the other's tip. The green arrow is the result.

The algebra is just component addition

You don't need to draw anything to compute a sum. Just add the x-components together and the y-components together:

[a, b]+[c, d]=[a+c, b+d][a,\ b] + [c,\ d] = [a+c,\ b+d]

That's it. No trick. The geometry (tip-to-tail) and the algebra (add the components) always give the same answer.

Properties worth knowing

  • Order doesn't matter: v1+v2=v2+v1\mathbf{v}_1 + \mathbf{v}_2 = \mathbf{v}_2 + \mathbf{v}_1 — try swapping them in the interactive
  • Adding zero does nothing: v+[0,0]=v\mathbf{v} + [0,0] = \mathbf{v}
  • Negative cancels: v+(v)=[0,0]\mathbf{v} + (-\mathbf{v}) = [0,0] — the arrow that points exactly backwards
The green parallelogram shape isn't just decoration — it shows that tip-to-tail works in either order. The sum arrow is always the diagonal of that parallelogram.

In code

import numpy as np

v1 = np.array([3, 1])
v2 = np.array([1, 3])

print(v1 + v2)   # [4, 4]

NumPy adds arrays element-wise by default. This is exactly vector addition — the same rule, just written as code.

What is a vector?Scalar Multiplication
drag either vector — the sum updates instantly
-6-6-5-5-4-4-3-3-2-2-1-1112233445566v₁ + v₂v₁v₂
v₁ = [3, 1]
v₂ = [1, 3]
v₁ + v₂ = [3 + 1, 1 + 3] = [4, 4]