Vectors
An arrow that means something
If I say "walk five steps", you will ask me one question: which way? Five steps on its own is not enough information. But if I say "walk five steps north", you know exactly where to go.
A vector is the second kind of instruction. It carries two things at the same time: how far, and which way.
We draw a vector as an arrow. A long arrow means a big amount. The way the arrow points is the direction. That is the whole idea — everything else on this page is just bookkeeping.
An amount that has both a size and a direction. We draw it as an arrow: the length of the arrow is the size, and the arrow points the way.
An amount with a size but no direction is called a scalar. "Five kilometres" is a scalar. "Twenty seconds" is a scalar. "Five kilometres north" and "twenty seconds later" are vectors. The little arrow on top — as in a with a hat — is how we show, on paper, that something is a vector.
- a(3, 2)
- length3.61
- direction33.7°
The two numbers that describe any arrow
To write a vector down so that somebody else can understand it, we use two numbers: how far across, and then how far up. The grid below shows why that works. Any arrow you can draw is really two smaller moves joined together — a move across, and a move up.
- a(4, 3)
- written as4 across, then 3 up
This arrow goes 4 across and 3 up, so we write it as (4, 3). The first number is always the across number and the second is always the up number. Always in that order, every time, like a house address where the street name comes before the number.
The two numbers that describe a vector. The pair (x, y) means "go x squares across, then y squares up".
The tall version is called a column vector. It means exactly the same thing as (4, 3) — it is just written standing up. Engineers and physicists like the tall one because a whole stack of them lines up neatly down the page.
People often call the across number x and the up number y. If a number is negative, the instruction flips: a minus in the across number means go left, and a minus in the up number means go down.
Read every pair the same way — across first, then up. Here are three arrows described in words.
How long is it? The magnitude
The length of a vector has its own grown-up name: the magnitude. There is nothing new to learn to find it — you already know the rule. The across number and the up number make a right triangle, and the arrow is the long side of that triangle.
- across² + up²16 + 9 = 25
- length√25 = 5
How long is the vector (4, 3)? Square both numbers, add them, then take the square root.
The two bars around a vector mean "the length of", in the same way that two bars around a number mean "the distance from zero". So writing the length of a equals 5 is a short way of saying: the arrow called a is five squares long.
A length is never negative. A vector can point left or down, but it can never be minus four squares long. The only arrow with length zero is the zero vector, (0, 0), and it is the one vector with no direction at all — it never goes anywhere.
Which way does it point?
Components describe a direction very precisely, but sometimes we want to say it out loud: "north-east", "halfway up", "twenty degrees above the ground". To do that we give the angle, measured anticlockwise from the arrow that points right. Trigonometry hands it to us.
Divide the up number by the across number, then ask your calculator for the inverse tangent of the answer.
Watch out when the across number is negative. A calculator only ever answers with angles between minus 90 and plus 90 degrees, so for an arrow pointing left it can be a half-turn out. Always sketch the arrow and check that the angle you got really points the way the arrow does.
Adding vectors: tip to tail
Imagine you walk 3 steps east. Then, from where you stopped, you walk 2 steps north. You made two moves — but you could also describe the whole trip with a single arrow: the straight one that runs from where you started to where you finished.
That is exactly how we add vectors. Put the tail of the second arrow onto the tip of the first one. The arrow that runs from the start to the finish is the sum.
- a(3, 1)
- b(-1, 2)
- a + b(2, 3)
Adding is just as easy without a picture. Add the numbers that belong together: across plus across, and up plus up.
Add the two across numbers, then the two up numbers. Nothing else changes.
The order does not matter: a + b is always the same as b + a. Draw the two orders and you get the same arrow both times, because you finish in the same place either way.
One warning. Measuring the empty space between two arrow tips is not adding. Two arrows that start from the same point are not lined up for adding yet. Slide the second one along — without turning it — until its tail touches the tip of the first one. Sliding an arrow around never changes it, so this is completely safe.
Stretching a vector
Multiplying a vector by an ordinary number stretches it or squashes it. That ordinary number has a name of its own: a scalar. Multiply by 2 and the arrow is twice as long. Multiply by one half and it is half as long. In every case, the arrow keeps pointing the same way.
- a(2, 1)
- k2
- k·a(4, 2)
- length4.47
The result of multiplying a vector by a number. It points the same way as the original when the number is positive, and the opposite way when the number is negative.
Multiply both numbers by the same amount, and keep the direction while the length changes.
Multiplying by minus one turns the arrow around without changing its length. The result is called the negative vector, written minus a. It points exactly the other way.
Taking one vector away from another
Subtracting is just adding the negative. So a minus b means a plus the negative of b. Draw it and something tidy appears: the answer is the arrow that starts at the tip of b and ends at the tip of a.
- a(3, 3)
- b(-2, 1)
- a − b(5, 2)
Subtract the across numbers, then the up numbers.
Subtract a vector from itself and you get the zero vector, (0, 0). It is the arrow with no length, and the only vector in the whole world that has no direction.
Where you draw an arrow does not matter
Two vectors are equal when they have the same length and point the same way. Where the arrow happens to sit on the page is not part of the vector. Slide it anywhere you like and it is still the same arrow.
Vectors with the same magnitude and the same direction. Moving an arrow around the page does not change it.
Vectors with the same magnitude but opposite directions. Adding one to the other gives the zero vector.
This is why vectors are so good at describing things that move. A wind blowing at thirty kilometres an hour towards the east is one single vector, whether it is blowing over your house or over the sea.
Go for a walk
Time to try it yourself. Press the buttons to walk one square at a time. Each press makes one small brown arrow, and the red arrow always shows the single move that would have taken you straight from your start to where you are now.
- steps walked4
- straight arrow(3, 1)
- as the crow flies3.16
The brown path and the red arrow are two different journeys between exactly the same two places. Different route, same sum. This is the single most useful thing about vectors: you can swap a messy wiggly path for one straight arrow whenever you only care where you ended up.
Vectors in the real world
A boat is trying to cross a river. Its engine pushes it towards the far bank, and the current pushes it downstream at the same time. Add those two vectors and you get the boat's real path across the water — which is why you always end up further downstream than you aimed.
A plane flying into a headwind has the same problem. The pilot aims the plane slightly sideways so that the plane's vector plus the wind's vector points at the airport.
Two people pushing a heavy box are adding vectors with their arms. If they push in the same direction the box slides easily. If one pushes sideways, part of their effort is wasted — the sum is smaller and it points somewhere in between.
In a video game, a character has a position and a velocity. The velocity is a vector: how far and in which direction the character moves each second. Add the velocity to the position again and again, sixty times a second, and you get smooth movement.
Whenever two things push or move at the same time, you add their vectors to find out what really happens. That single idea is why pilots, sailors, engineers, animators and game programmers all learn vectors early.
Three numbers, or even more
On a flat page, two numbers are enough. In the real world we often need a third one: across, up, and forward. Then we write the vector with three numbers instead of two, like (x, y, z). A drone needs three numbers to describe a movement, and so does a satellite.
Everything you learned on this page still works with three numbers. You add across with across, up with up, and forward with forward — and the length is Pythagoras with one more square inside the root.
Check yourself
Try each one on paper first. Then click the question to see whether you were right — every answer comes with the working, so you can find out where a slip happened.
Write the vector that goes 7 squares across and 2 squares down.
Across first, up second. Going down is the negative direction for the up number, so the vector is (7, −2). The minus sign is the only thing that says "down" — we never write "up minus two".
How long is the vector (6, 8)?
Square both numbers, add them, then take the square root: 36 + 64 = 100, and the square root of 100 is 10. This one comes out as a whole number, which is a nice coincidence — most vectors have untidy lengths.
Add (2, 5) and (3, −1).
Add across with across and up with up: 2 + 3 = 5 across, and 5 + (−1) = 4 up. The sum is (5, 4).
What is 3 multiplied by the vector (−1, 2)?
Multiply each number by 3: 3 × (−1) = −3 and 3 × 2 = 6, so the answer is (−3, 6). It points the same way as (−1, 2) but it is three times as long.
Rani walks 3 steps east and then 4 steps north. Where does she finish, and how far is that from where she started?
East then north is a walk in two directions, so it is two vectors added tip to tail: (3, 0) + (0, 4) = (3, 4). She finishes 3 across and 4 up from her start, and the straight-line distance is 5 steps, because 9 + 16 = 25 and the square root of 25 is 5. She walked 7 steps, but she is only 5 steps away — a very useful difference to know.
Is (2, 3) the same vector as (3, 2)?
No. The first goes 2 across and then 3 up; the second goes 3 across and then 2 up. Drawn from the same starting point they finish in different places, so they are different vectors even though they use the same two numbers in a different order. Order matters.
What is (5, −2) minus (5, −2)?
Subtracting a vector from itself gives the zero vector, (0, 0). It is the one arrow with no length, and because it has no length it also has no direction to point in.
What comes next
You now know what a vector is, how to write one down, how long it is, which way it points, and how to add, stretch and subtract them. That is the whole foundation.
The next topic in this library, Vectors & Matrices, takes these same arrows further. It introduces the dot product, which measures how much two vectors agree on a direction, and the cross product, which builds a new vector out of two others. After that come matrices — grids of numbers that can turn, stretch or squash every vector in the plane at once. All of it is built out of the arrows on this page.
If you remember only one thing, remember this: a vector is an arrow with a length and a direction, and to add two of them you put them tip to tail.