← All articles
mathvectorslinear algebraphysicsOctober 14, 20268 min read

What Is a Vector? Arrows, Coordinates and the Mathematics of Direction

By the BrainSnail editorial team. How these articles are written and checked, and how to tell us when one is wrong.

Walk three kilometres and you have described a distance; walk three kilometres north and you have described a displacement, and the difference between the two is the whole idea of a vector. Some quantities are just amounts, temperature, mass, price, and some come with a direction attached, velocity, force, the wind, the push of a magnet, and the mathematics that handles the second kind, invented in the 1840s and refined through the 1880s, is now the language in which physics is written, in which a video game moves a character, and in which a search engine decides that two documents are alike.

Arrow and list

A vector can be pictured as an arrow, whose length is the size of the quantity and whose direction is its direction, and two arrows are the same vector if they have the same length and direction wherever they are drawn. It can also be written as a list of numbers, its components along fixed axes: a displacement of three kilometres north and four east is the vector (4, 3), and its length, by Pythagoras, is five. The two views are the same thing, and each is convenient for something; the arrow shows what is happening, the list lets it be calculated. A vector in three dimensions has three components, and the mathematics does not care about the number, so that a vector with a thousand components, which cannot be drawn, is handled by the same rules as one with two.

Adding and scaling

Vectors add head to tail. A walk of (4, 3) followed by a walk of (1, 2) ends at (5, 5), the components added one by one, and the arrow from start to finish is the sum; the same picture gives the result of two forces acting on one body, or a boat's velocity in a current. Multiplying a vector by a number scales its length without turning it, and by a negative number reverses it, so that subtraction is adding the reverse. Those two operations, addition and scaling, are all that a vector space needs, and anything that obeys them, arrows, lists, polynomials, sound waves, the states of a quantum system, is treated by the same algebra. The operations:

  • •Addition: components added, arrows laid head to tail; commutative and associative like ordinary addition
  • •Scalar multiplication: every component multiplied by the number, stretching or shrinking the arrow
  • •The dot product: the sum of the products of matching components, giving a number that measures how much two vectors point the same way; zero when they are at right angles
  • •The cross product, in three dimensions only: a new vector at right angles to both, with length equal to the area of the parallelogram they span, used for torque, magnetic force and the orientation of surfaces
  • •Length, or norm: the square root of the dot product of a vector with itself

Why physics uses them

Newton's second law, force equals mass times acceleration, is a vector equation: the acceleration is in the direction of the force, and a body pushed north and east at once accelerates diagonally, which the components handle automatically. Velocity, momentum, the electric and magnetic fields, the flow of a fluid at every point, all are vectors, and the laws that relate them are written in a notation that Josiah Willard Gibbs and Oliver Heaviside distilled in the 1880s from William Rowan Hamilton's quaternions of 1843, which Hamilton had carved on a Dublin bridge in the moment of discovery and which turned out to be more machinery than physics needed. Maxwell's four equations of electromagnetism, which fill a page in components, fit on a line in vectors, and the compactness is not cosmetic; it shows that the laws are the same whichever way the axes point, which is a physical fact about space.

Why computers use them

A point on a screen is a vector, a colour is a vector of three components, red, green and blue, and a character in a game is a few thousand points that are moved, rotated and lit by vector arithmetic thousands of times a second, which is what a graphics card is built to do in bulk. A word, in a modern language model, is a vector of several hundred components, learned so that words used in similar ways point in similar directions, and the dot product between two of them measures their similarity; the arithmetic in which king minus man plus woman comes out near queen is vector addition. A search engine represents a document as a vector of the words it contains and finds the documents nearest to a query by the angle between them, and a recommendation system does the same with viewers and films. The machine learning of the 2020s is, at its base, very large vectors being multiplied by very large tables of numbers.

Beyond arrows

The abstraction, made in the twentieth century, is that a vector is anything that can be added and scaled, and the space it lives in is defined by those rules rather than by a picture. Functions form a vector space, since two functions can be added and one can be scaled, and that is the setting of Fourier's decomposition of a signal into sines and of quantum mechanics, where a particle's state is a vector and the measurable quantities are what the dot product yields. The arrow that a schoolchild draws for a force and the state of an electron are the same object in the same algebra, which is why the subject built to describe a walk of three kilometres north describes most of what physics and computing now do.

Work, shadows and a sledge on a slope

Suppose you pull a sledge 10 metres across flat snow with a rope angled upwards, and the rope's pull is 50 newtons. Only part of that pull moves the sledge forward; the rest lifts it slightly and is wasted as far as the journey is concerned. The dot product sorts this out for you. Physicists define the work done as the dot product of the force vector and the displacement vector, which equals the size of the force times the distance times the cosine of the angle between them. At a 60 degree angle the cosine is one half, so you do 250 joules of work rather than 500.

The same calculation has a geometric picture called a projection. Shine a light straight down on the rope's force arrow and the shadow it casts along the ground is the useful part, the component in the direction of motion. Projections are everywhere: the share of sunlight that actually hits a tilted solar panel, the part of gravity that pulls a skier down a slope rather than into it, and the way a graphics program decides how brightly a surface is lit by comparing the direction it faces with the direction of the lamp. In each case the question is how much of one vector lies along another.

Speed, velocity and the lap that goes nowhere

A runner who completes one lap of a 400 metre track in 80 seconds has an average speed of 5 metres per second. Their average velocity over the lap is zero, because they finish where they started and their displacement vector has no length. This is not a trick of words. Speed is a scalar, the distance covered divided by the time, while velocity is a vector, the displacement divided by the time, and it can be small or zero even when a lot of ground has been covered.

The difference matters whenever you have to steer. A pilot flying east while a wind blows from the north cannot simply point the plane east, because the aircraft's velocity through the air and the wind's velocity add as vectors, and the plane would drift south. Instead the pilot turns the nose slightly into the wind, so that the sum of the two vectors points where the plane needs to go. Swimmers crossing a river and drones holding position in a breeze solve the same problem, adjusting their own vector so the total comes out right.

Things with a direction that are not vectors

It is tempting to think that anything with a size and a direction is a vector, but the real test is whether it adds like one. Try this with a book lying flat in front of you. Turn it a quarter turn about a left-right axis, then a quarter turn about a vertical axis, and note how it ends up. Start again and make the same two turns in the opposite order. The book finishes in a different position. A rotation has a size, its angle, and a direction, its axis, but because the order matters, rotations through finite angles do not obey vector addition.

Very small rotations, and the rate of turning called angular velocity, do add as vectors, which is why physics can still describe spin with vector tools. Electric current is the opposite surprise. Current in a wire flows in a direction, yet when two wires meet at a junction their currents simply add as numbers, whatever angle the wires make with each other, so current is treated as a scalar in circuit calculations. Being a vector is a matter of behaviour rather than appearance, which is exactly what the modern definition says: a quantity earns the name by obeying the rules of addition and scaling.

The takeaway

A vector is a quantity with magnitude and direction, drawn as an arrow and written as a list of components, added head to tail and scaled by numbers, with a dot product that measures alignment and, in three dimensions, a cross product that gives a perpendicular. Physics is written in vectors because forces, velocities and fields have direction and the laws do not depend on the axes, computers use them for every point, colour, word and document, and the abstraction extends to any objects that can be added and scaled.

Practise this

Questions from Higher Mathematics

Reading about something is not the same as being able to recall it. These are real questions from the Higher Mathematics unit in our Math track, answers and explanations included. The unit has 120 in total across 21 steps.

  • Fill the blankLevel 4

    1. The ____ of the 2x2 matrix [[a,b],[c,d]] equals ad - bc.

    • determinantcorrect
    • trace
    • inverse
    • transpose

    That number is the determinant; it tells you whether the matrix is invertible.

  • Choose all that applyLevel 5

    2. Which of these are logical connectives? (Select all that apply.)

    • Conjunction (AND)correct
    • Disjunction (OR)correct
    • Negation (NOT)correct
    • Factorial

    Conjunction (AND), disjunction (OR), and negation (NOT) are connectives; factorial is an arithmetic operation.

  • Fill the blankLevel 4

    3. The set of all ____ (like -2, 0, and 5) is written Z.

    • integerscorrect
    • primes
    • fractions
    • decimals

    Z stands for the integers, the whole numbers together with their negatives and zero.