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.
Describe this picture
A square grid with the origin marked, and a second arrow, , starting at the origin. An arrow grows from the origin. Then slides along until its tail sits on the tip of . Then the sum draws from the origin to the end of the chain. Last, a faded copy of 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 , and the sum. One control, once the clip has finished: drag the tip of , 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, : 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 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, , so you can tell them from ordinary numbers. The numbers in the list are the vector’s components: is the first (across) and the second (up). For , and . 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 , but I may slide it anywhere without changing it.
Adding arrows: tip to tail
Make one move, then another. Walk , then from where you stopped walk . Altogether you went across and up. That total move is the sum :
In the picture, you place the tail of on the tip of , 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 first, then , and you end at the same place. The two routes are the two sides of a parallelogram, and the sum is its diagonal:
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 round until it points away from , and watch the sum arrow shrink while the chain stays as long.
Scaling an arrow
Walk twice in a row and you have walked : the same direction, twice as far. Multiplying a vector by an ordinary number multiplies every component by :
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:
- : the same direction, twice as long.
- : half as long.
- : no move at all. This is the zero vector, written , an arrow shrunk to a point.
- : 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: . In numbers,
The picture is worth remembering. Draw and from the origin. The arrow from the tip of to the tip of is . The check is one addition: start at the tip of , walk , and you arrive at .
So 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.
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: . 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 real numbers is written (“R n”). The plane is , the room is , and the row of pixels lives in .
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 samples form one vector in . Signal processing counts samples from 0 and linear algebra counts components from 1, so , , and so on. Adding two signals sample by sample is adding two vectors.
Worked example
Take and .
- Sum. .
- Difference. : the arrow from the tip of , at , to the tip of , at .
- A mixture. .
- Flip. .
- Signals. A short pulse plus a constant level gives : the same pulse, lifted by 0.5 everywhere.
Predict before you check: what does 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 km/h through the air, 200 km/h due east. The wind blows at km/h. Over the ground it moves at the sum, km/h: slower eastward, and drifting north.
Colours. A screen colour is a vector of three numbers, red, green and blue: 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 . Linear algebra treats such long lists with the same rules you met here.
Reference card
| Quantity | Formula | Notes |
|---|---|---|
| Vector | an arrow and a list; components counted from 1 | |
| Sum | tip to tail; | |
| Scaling | stretch, shrink, or flip when | |
| Zero vector | no move: a point at the origin | |
| Difference | the arrow from the tip of to the tip of | |
| All lists of numbers | the same rules, one component at a time | |
| A signal as a vector | components from 1, samples from 0 |