Skip to content

Vectors

Read a vector as an arrow and as a list of numbers, add arrows tip to tail, scale them, and see a sound clip as one long vector.

This topic

First, the picture

A vector is a move: so many steps across, so many up. Watch two moves join tip to tail into one.

Adding arrows

Tip to tail: the second arrow starts where the first one ends.

w = (1, 2) starts at the origin: 1 across, 2 up.

v
(3, 1)
w
(1, 2)
v + w
–
0.00 / 14.30 s
Describe this picture

A square grid with the origin marked, and a second arrow, w=(1,2)\mathbf{w}=(1,2), starting at the origin. An arrow v=(3,1)\mathbf{v}=(3,1) grows from the origin. Then w\mathbf{w} slides along until its tail sits on the tip of v\mathbf{v}. Then the sum v+w=(4,3)\mathbf{v}+\mathbf{w}=(4,3) draws from the origin to the end of the chain. Last, a faded copy of v\mathbf{v} stretches to twice its length, shrinks to a point at the origin, and flips round to point the other way. Readouts give the coordinates of v\mathbf{v}, w\mathbf{w} and the sum. One control, once the clip has finished: drag the tip of v\mathbf{v}, or move it with the arrow keys, in steps of half a unit; the chain, the sum, the flipped copy and the readouts follow.

An arrow and a list

Say I tell you: “walk 3 steps east, then 1 step north.” That instruction is a vector. You can draw it as an arrow from where you start to where you end. You can also write it as a list of two numbers, (3,1)(3,1): steps across, then steps up.

The arrow and the list are the same thing seen two ways. On the grid at the top of the page, drag the tip of v\mathbf{v} and watch its readout change with it. Every place you can put the tip is one pair of numbers, and every pair of numbers is one place for the tip.

I write vectors in bold, v\mathbf{v}, so you can tell them from ordinary numbers. The numbers in the list are the vector’s components: v1v_1 is the first (across) and v2v_2 the second (up). For v=(3,1)\mathbf{v}=(3,1), v1=3v_1=3 and v2=1v_2=1. I count components from 1.

An arrow does not belong to one spot. The move “3 east, 1 north” is the same move wherever you start it. Usually I draw a vector from the origin, the point (0,0)(0,0), but I may slide it anywhere without changing it.

Adding arrows: tip to tail

Make one move, then another. Walk v=(3,1)\mathbf{v}=(3,1), then from where you stopped walk w=(1,2)\mathbf{w}=(1,2). Altogether you went 3+1=43+1=4 across and 1+2=31+2=3 up. That total move is the sum v+w\mathbf{v}+\mathbf{w}:

v+w=(v1+w1,  v2+w2)=(3+1,  1+2)=(4,3).\begin{aligned} \mathbf{v}+\mathbf{w}&=(v_1+w_1,\;v_2+w_2)\\ &=(3+1,\;1+2)=(4,3). \end{aligned}

In the picture, you place the tail of w\mathbf{w} on the tip of v\mathbf{v}, tip to tail. The sum is the single arrow from the start of the chain to its end. In the numbers, you add the components one by one.

The order does not matter. Walk w\mathbf{w} first, then v\mathbf{v}, and you end at the same place. The two routes are the two sides of a parallelogram, and the sum is its diagonal:

v+w=w+v.\mathbf{v}+\mathbf{w}=\mathbf{w}+\mathbf{v}.

Watch out

Arrows add, lengths do not. The sum arrow cuts straight across from the start of the chain to its end, so it is never longer than the two arrows laid end to end, and shorter whenever the chain bends. Drag the tip of v\mathbf{v} round until it points away from w\mathbf{w}, and watch the sum arrow shrink while the chain stays as long.

Scaling an arrow

Walk v\mathbf{v} twice in a row and you have walked (6,2)(6,2): the same direction, twice as far. Multiplying a vector by an ordinary number cc multiplies every component by cc:

c v=(c v1,  c v2).c\,\mathbf{v}=(c\,v_1,\;c\,v_2).

An ordinary number used this way is called a scalar, because it scales the arrow. Four scalars tell the whole story, and the end of the clip at the top of the page plays them in turn:

  • 2v=(6,2)2\mathbf{v}=(6,2): the same direction, twice as long.
  • 12v=(1.5, 0.5)\tfrac12\mathbf{v}=(1.5,\,0.5): half as long.
  • 0 v=(0,0)0\,\mathbf{v}=(0,0): no move at all. This is the zero vector, written 0\mathbf{0}, an arrow shrunk to a point.
  • −v=(−3,−1)-\mathbf{v}=(-3,-1): the same length, pointing the opposite way.

A scalar can stretch, shrink or flip an arrow. It can never turn it to a new direction off its line.

Subtracting: from one tip to the other

Subtraction is adding the flipped arrow: w−v=w+(−v)\mathbf{w}-\mathbf{v}=\mathbf{w}+(-\mathbf{v}). In numbers,

w−v=(w1−v1,  w2−v2)=(1−3,  2−1)=(−2,1).\begin{aligned} \mathbf{w}-\mathbf{v}&=(w_1-v_1,\;w_2-v_2)\\ &=(1-3,\;2-1)=(-2,1). \end{aligned}

The picture is worth remembering. Draw v\mathbf{v} and w\mathbf{w} from the origin. The arrow from the tip of v\mathbf{v} to the tip of w\mathbf{w} is w−v\mathbf{w}-\mathbf{v}. The check is one addition: start at the tip of v\mathbf{v}, walk w−v\mathbf{w}-\mathbf{v}, and you arrive at v+(w−v)=w\mathbf{v}+(\mathbf{w}-\mathbf{v})=\mathbf{w}.

So w−v\mathbf{w}-\mathbf{v} answers the question “how do I get from here to there?” A game uses it to point a character at a target. A radar uses it for the gap between two aircraft.

More than three numbers

Nothing above needed the list to have two numbers. A point in a room has three: across, along and up. The rules are the same: add component by component, scale every component.

Now take eight pixels from one row of a photo. Each has a brightness, so the row is a list of eight numbers. Or take eight samples of a sound, eight numbers measured one after another. Each list is one vector, with eight components.

Long vectors

A row of pixels and a stretch of sound: each one list of eight numbers.

Eight pixels from one row of a photo, brightness 0 for black to 1 for white: one list of eight numbers, one vector.

0.00 / 8.75 s
Describe this picture

Two panels. In the first, eight pixels of one image row, drawn as eight bars shaded with their own brightness, from 0 for black to 1 for white, and under them the same eight numbers as one list. In the second, eight samples of a sound grow in as bars, with their list. Then a second sound appears as thin bars beside the first, with its list. One entry at a time, each thin bar slides onto the tip of its partner, the bar grows or shrinks to the sum, and the list of sums fills in: (0.2, 0.3, 1, 0.3, 0.2, −0.7, −0.6, −0.7)(0.2,\,0.3,\,1,\,0.3,\,0.2,\,-0.7,\,-0.6,\,-0.7). There is no control.

Watch the bars while the second list is added. Each bar only ever meets its own partner, the bar in the same place. That is the same rule as tip to tail, used eight times.

You can’t draw an arrow in eight dimensions, but you don’t need to. The list carries everything the arrow would. The set of all lists of nn real numbers is written Rn\mathbb{R}^n (“R n”). The plane is R2\mathbb{R}^2, the room is R3\mathbb{R}^3, and the row of pixels lives in R8\mathbb{R}^8.

In signal processing · a signal is a vector

In What a signal is, in the signal processing course, a signal is one value at each moment. Its first NN samples x[0],x[1],…,x[N−1]x[0],x[1],\dots,x[N-1] form one vector x\mathbf{x} in RN\mathbb{R}^N. Signal processing counts samples from 0 and linear algebra counts components from 1, so x1=x[0]x_1=x[0], x2=x[1]x_2=x[1], and so on. Adding two signals sample by sample is adding two vectors.

Worked example

Take v=(3,1)\mathbf{v}=(3,1) and w=(1,2)\mathbf{w}=(1,2).

  1. Sum. v+w=(3+1,  1+2)=(4,3)\mathbf{v}+\mathbf{w}=(3+1,\;1+2)=(4,3).
  2. Difference. w−v=(1−3,  2−1)=(−2,1)\mathbf{w}-\mathbf{v}=(1-3,\;2-1)=(-2,1): the arrow from the tip of v\mathbf{v}, at (3,1)(3,1), to the tip of w\mathbf{w}, at (1,2)(1,2).
  3. A mixture. 2v+w=(6,2)+(1,2)=(7,4)2\mathbf{v}+\mathbf{w}=(6,2)+(1,2)=(7,4).
  4. Flip. −v=(−3,−1)-\mathbf{v}=(-3,-1).
  5. Signals. A short pulse x=(0, 0.5, 1, 0.5)\mathbf{x}=(0,\,0.5,\,1,\,0.5) plus a constant level y=(0.5, 0.5, 0.5, 0.5)\mathbf{y}=(0.5,\,0.5,\,0.5,\,0.5) gives x+y=(0.5, 1, 1.5, 1)\mathbf{x}+\mathbf{y}=(0.5,\,1,\,1.5,\,1): the same pulse, lifted by 0.5 everywhere.

Predict before you check: what does 0⋅v0\cdot\mathbf{v} look like on the grid? It is a point at the origin, the zero vector.

Where you’ll meet this

Moving through wind. An aircraft flies at (200,0)(200,0) km/h through the air, 200 km/h due east. The wind blows at (−30,40)(-30,40) km/h. Over the ground it moves at the sum, (170,40)(170,40) km/h: slower eastward, and drifting north.

Colours. A screen colour is a vector of three numbers, red, green and blue: (255,128,0)(255,128,0) is orange. Blending two colours mixes their vectors.

Games and graphics. A game stores every position and velocity as a vector. Each frame it adds velocity to position to move things along.

Sound. One second of audio sampled 8,000 times a second is one vector with 8,000 components, a single point in R8000\mathbb{R}^{8000}. Linear algebra treats such long lists with the same rules you met here.

Reference card

QuantityFormulaNotes
Vectorv=(v1,v2)\mathbf{v}=(v_1,v_2)an arrow and a list; components counted from 1
Sumv+w=(v1+w1,  v2+w2)\mathbf{v}+\mathbf{w}=(v_1+w_1,\;v_2+w_2)tip to tail; v+w=w+v\mathbf{v}+\mathbf{w}=\mathbf{w}+\mathbf{v}
Scalingc v=(c v1,  c v2)c\,\mathbf{v}=(c\,v_1,\;c\,v_2)stretch, shrink, or flip when c<0c<0
Zero vector0=0 v\mathbf{0}=0\,\mathbf{v}no move: a point at the origin
Differencew−v=(w1−v1,  w2−v2)\mathbf{w}-\mathbf{v}=(w_1-v_1,\;w_2-v_2)the arrow from the tip of v\mathbf{v} to the tip of w\mathbf{w}
All lists of nn numbersRn\mathbb{R}^nthe same rules, one component at a time
A signal as a vectorxq=x[q−1]x_q=x[q-1]components from 1, samples from 0

Keep reading with a free account.

By creating an account you accept the terms of use.

Sign in

Already have an account? Use the service you signed up with.

Or keep reading: get new lessons by email

Are you 13 or over?

Accounts and email updates are for people aged 13 or over. We keep only your answer, never your date of birth.

End of the lesson

Where to go next.

Phasorium

Account

Sign inKeep your place on any device

Subjects

Site

Look