Vectors

☰ Contents

A vector is a quantity with both a size and a direction. A distance of 5 km is a scalar. A move of 5 km north-east is a vector. In three dimensions, lines, planes and the angles and distances between them all come from two products: the dot product and the vector product.

What is a vector?

A vector has a size and a direction, while a scalar has size alone: a speed of 20 km/h is a scalar, but a wind of 20 km/h from the northwest is a vector. Drawn as an arrow, its length is the size and its head shows the direction. To calculate, write the step across and the step up as components: (4, 1) means 4 across and 1 up. The arrow from (2, 5) to (6, 6) is that vector, because 6 − 2 = 4 and 6 − 5 = 1. A vector records a movement, not a place, so arrows with the same components are the same vector wherever they start. A negative component points the other way: (−4, 1) goes 4 to the left. Check by components: the arrow from (0, 0) to (4, 1) has components 4 − 0 = 4 and 1 − 0 = 1, so it is the same vector.

xya
a = (3, 2) means 3 across and 2 up. A vector carries a direction, not just a size. Full lesson: Vectors

A column vector writes the step across on top.

xya
The vector goes 4 across and 3 up. A column vector writes the horizontal step on top. Full lesson: Column Vectors

The arrow from (1, 1) to (4, 3) and the arrow from (0, 0) to (3, 2) are the same vector too, because both mean 3 across and 2 up.

xya−a
Negating a vector keeps its length and reverses its direction. Full lesson: Column Vectors

See Vectors and Column vectors.

How do you add and subtract vectors?

To add two vectors, add their matching components, across with across and up with up. For (3, 1) and (1, 2), the sum is (4, 3), since 3 + 1 = 4 and 1 + 2 = 3. On a diagram, start the second arrow where the first ends; the sum, called the resultant, runs from the first start to the last finish. This works because across and up moves never affect each other, so the order does not matter either. Subtraction changes one step: subtract the matching components, which is the same as adding the negative of the second vector, the arrow turned around. So (3, 1) − (1, 2) is (2, −1), because 3 − 1 = 2 and 1 − 2 = −1. Check a difference by adding it back: (2, −1) + (1, 2) should return (3, 1), and 2 + 1 = 3 with −1 + 2 = 1 confirms it.

−4−2246−224xy(2, 3)

b = (−1, 2)

Make the resultant lie along the y-axis

xyaa + b
You land at (5, 5): 3 + 2 = 5 across and 1 + 4 = 5 up. Each part adds. Full lesson: Adding Vectors

If a and b are the position vectors of two points, then b − a is the arrow from the first point to the second: destination minus start.

xyBA
The gap between two points is exactly this move: destination minus start. Full lesson: Subtracting Vectors

Multiplying a vector by a number is scalar multiplication. Multiplying by 3 makes the arrow three times as long in the same direction. A negative number reverses it as well. Two vectors are parallel exactly when one is a scalar multiple of the other.

xya3a
The scalar 3 makes three copies of one journey: 3a takes (2, 1) out to (6, 3). Full lesson: Scalar Multiplication

See Adding vectors, Subtracting vectors and Scalar multiplication.

Now you

xyab

The drawing chains a then b. Where does the journey end?

xyab

(-4, -2) + (-2, 2) is what?

What is the magnitude of a vector, and what is a unit vector?

The magnitude of a vector is the length of its arrow, written |a|, and a unit vector has length 1. The components are the shorter sides of a right triangle with the vector as hypotenuse, so Pythagoras gives the length: |(3, 4)| = √(3² + 4²) = 5, since 9 + 16 = 25. For a unit vector in the same direction, divide each component by the magnitude: (3, 4) becomes (3/5, 4/5). Both components shrink by the same factor, so the arrow gets shorter without turning. Signs do not affect the length, because each component is squared: |(−5, 12)| is 13, since 25 + 144 = 169. In three dimensions a third square joins the sum. The zero vector has no unit vector, because it has no direction and dividing by 0 is undefined. Check a unit vector by finding its length: the squares of 3/5 and 4/5 are 9/25 and 16/25, and 9/25 + 16/25 = 1.

θ = 60°show the unit tiles

at 60° the term −2ab cos θ is −12, so a² + b² and c² are not equal

Find the angle where a² + b² = c²

xya
Three across and four up draws a right triangle with the vector as its hypotenuse. Full lesson: Magnitude of a Vector

Any vector is its length times its unit vector, so (3, 4) is 5 lots of (3/5, 4/5).

aâ1
The short arrow points exactly the same way, and its length is now one. Full lesson: Unit Vectors

i is one step along the x-axis and j is one step along the y-axis, so 3i + 4j is the vector (3, 4). The position vector of a point is the vector from the origin O to that point, and the vector from A to B is AB = OB − OA.

xyOAAB
In numbers: OB − OA = (2 − 5, 6 − 2) = (−3, 4), so 3 back and 4 up. Full lesson: Position Vectors

See Magnitude of a vector, Unit vectors, The unit vectors i and j and Position vectors.

Now you

xya

How long is the vector (5, 12)?

xyAB

A is at (3, 3) and B at (9, 11). How long is AB?

How do you prove a geometry result with vectors?

Write each point as a position vector from an origin O, express the lines in those vectors, and read the result from the algebra, where parallel lines appear as scalar multiples. For the midpoint M of AB, walk to A and then half of the gap: OM = a + ½(b − a) = ½(a + b). With A at (2, 6) and B at (8, 2), M is at (5, 4), since 2 + 8 = 10 and 6 + 2 = 8, each then halved. The method works because a vector carries length and direction, so one equation can prove two facts. Points on one line need a different step: show that AC is a multiple of AB, with one multiplier for every component. For A(1, 1), B(3, 2) and C(7, 4), AB is (2, 1) and AC is (6, 3), three times AB. Check AC: 7 − 1 = 6 and 4 − 1 = 3.

OM = OA + ½ABAB is b minus a — subtraction again= a + ½(b − a)half of each endpoint, added= ½(a + b)
Walk to A, then half the gap — the algebra simplifies to half of a plus b. Full lesson: Vector Proofs with Midpoints

In triangle OAB, let P and Q be the midpoints of OA and OB. Then PQ = ½b − ½a = ½AB. Because PQ is a multiple of AB, this one line proves that PQ is parallel to AB and half its length.

xyABPQ
To prove PQ parallel to AB, show one is a multiple of the other. That is all. Full lesson: Vector Proofs with Midpoints

Parallel vectors pass the same test, and the multiplier also gives the ratio of their lengths.

xyab
Now compare b = (3, 4) with a = (2, 1): 3 is 1.5 × 2, but 4 is 4 × 1. Full lesson: Collinear Vectors

See Vector proofs with midpoints and Collinear vectors.

Now you

xyab

Are (2, 3) and (7, 9) along the same line?

xyab

Are (4, 4) and (12, 12) along the same line?

What does the dot product actually measure?

The dot product measures how far two vectors point the same way. Multiply the matching components and add: (a₁, a₂) · (b₁, b₂) = a₁b₁ + a₂b₂, a number, not a vector. For (3, 4) and (2, 1), it is 10, since 3 × 2 + 4 × 1 = 6 + 4 = 10. The same number equals |a| |b| cos θ, with θ the angle between the arrows: |a| times the length of the shadow of b on a. So it is positive for an acute angle, zero for a right angle, and negative for an obtuse one. A vector dotted with itself has θ = 0 and cos 0 = 1, giving its length squared: (3, 4) · (3, 4) is 25, the square of 5. Check a dot product both ways: for (1, 0) and (1, 1), the components give 1 × 1 + 0 × 1 = 1, and 1 × √2 × cos 45° is also 1.

abθ = 140°shadow |b| cos θ −2.3

past 90° the shadow points against a, so a · b = |a| × shadow is negative: −9.19

Swing b until a · b = 0

(3, 1) · (2, 4)multiply the matching parts3×2 + 1×4then add — one number, not an arrow10
Multiply matching components — across with across, up with up — then add. Full lesson: The Dot Product

Among vectors of fixed lengths, it is largest when they point exactly the same way.

b along aab
It is a’s length times the part of b lying along a — biggest when the two line up. Full lesson: The Dot Product

To find the angle, divide the dot product by both lengths: cos θ = a · b / (|a| |b|). Perpendicular vectors have a dot product of zero, because cos 90° = 0.

read the projection fact backwards
a · b = |a| |b| cos θ, so dividing by both lengths leaves cos θ on its own. Full lesson: The Angle Between Vectors

See The dot product and The angle between vectors.

Now you

a

Which pair is perpendicular? Check the dot products.

a · b = 0what angle does zero force?

Two vectors have a dot product of 0. What is the angle between them?

How do vectors work in three dimensions?

A vector in three dimensions has a third component, for depth: (2, 3, 6) means 2 across, 3 up and 6 out, also written 2i + 3j + 6k, where k is one step along the z-axis. Addition, scalar multiplication and the dot product work as in two dimensions, one component at a time. For (2, 3, 6) and (1, −2, 4), the sum is (3, 1, 10), and the dot product is 2 − 6 + 24 = 20. The rules carry over because the three axes are perpendicular, so a move along one leaves the other coordinates alone. The magnitude changes form. It needs Pythagoras twice, across the floor and then up to the tip, so three squares sit under the root: √(x² + y² + z²). The cross product is new. Check the sum component by component: 2 + 1 = 3, 3 − 2 = 1 and 6 + 4 = 10.

√(x² + y²) = 3.61x = 2y = 3z = 4|v| = √(3.61² + 4²)= √(2² + 3² + 4²) = 5.39

the floor diagonal is √(x² + y²) = 3.61; stand z = 4 on its end and Pythagoras again gives |v| = √(3.61² + 4²) = 5.39, which is √(x² + y² + z²)

Make the box 3 by 4 by 12 and read the diagonal

263
A third number for depth: (2, 3, 6) cuts corner to corner through a box. Full lesson: Vectors in Three Dimensions

The length of (2, 3, 6) is √(4 + 9 + 36) = 7.

|(2, 3, 6)|one square per component — one more than before
The length just gains one more square: the root of 4 + 9 + 36 is 7. Full lesson: Vectors in Three Dimensions

The distance between two points is the magnitude of the vector between them. The midpoint averages each coordinate on its own, z included.

A(1, 2, 3), B(7, 10, 27)gaps 6, 8 and 24
A(1, 2, 3) to B(7, 10, 27): the gaps are 6, 8 and 24, so the distance is 26. Full lesson: Distance and Midpoint in Three Dimensions

See Vectors in three dimensions and Distance and midpoint in three dimensions.

What is the vector equation of a line?

A line is fixed by one point on it, with position vector a, and one direction d. Every point of the line is r = a + t d for some number t, the parameter. For the line through (1, 2, 0) with direction (2, −1, 3), t = 2 gives (5, 0, 6), since 1 + 2 × 2 = 5, 2 − 1 × 2 = 0 and 0 + 3 × 2 = 6. It works because any point is reached by walking to a, then t steps along d. Any multiple of d, such as (4, −2, 6), gives the same line. For a line through two points A and B, use a as the point and b − a as the direction. To test a point, solve for t in one component and check the rest: (7, −1, 9) needs t = 3, since 1 + 2 × 3 = 7, and the other two components agree.

a0.5dOr = a + λd = (1, 1) + 0.5(2, 1) = (2, 1.5)

λ = 0.5: r = a + λd = (2, 1.5), λ copies of d laid head to tail from A, and sweeping λ through every value traces the whole line

Slide P to λ = 2 and read r = a + 2d

xyadd
Start at a, then walk copies of d — every stride lands on the same line. Full lesson: The Vector Equation of a Line

The Cartesian form removes the parameter. Make t the subject of each coordinate equation and set the three expressions equal: (x − a₁)/d₁ = (y − a₂)/d₂ = (z − a₃)/d₃. The numerators give the point and the denominators give the direction.

So set them equal. That is the Cartesian form, with the parameter gone. Full lesson: The Cartesian Form of a Line

In space, two lines that are not parallel can still miss each other, like a bridge and the road under it. Such lines are skew. Set the two positions equal, solve two of the three component equations for t and s, and substitute into the third. If it holds, the lines meet. If it fails, they are skew.

t − s = 4 and t + s = 0from the first two rows onlyt = 2, s = −2
Solve any two of them. The x and y rows give t = 2 and s = −2. Full lesson: Intersecting and Skew Lines

See The vector equation of a line, The Cartesian form of a line and Intersecting and skew lines.

What is the cross product for?

The cross product, or vector product, a × b is a vector at right angles to both a and b: a × b = (a₂b₃ − a₃b₂, a₃b₁ − a₁b₃, a₁b₂ − a₂b₁). For (1, 0, 0) and (0, 1, 0) it gives (0, 0, 1), since the last component is 1 × 1 − 0 × 0 = 1: two steps across the floor give one straight up. It makes a normal to a plane from two directions in it. Its dot product with a, and with b, is zero, which is what perpendicular means. Order matters: b × a = −(a × b), and parallel vectors give the zero vector. Its length is the area of their parallelogram. Check with a dot product: for a = (1, 2, 0) and b = (0, 1, 3), a × b is (6, −3, 1), and 1 × 6 + 2 × (−3) + 0 × 1 = 0.

aba × bθ = 60°|a × b| = |a||b| sin θ = 5.2

a × b stands perpendicular to both, as long as the parallelogram's area |a||b| sin θ

Swing b until it is parallel to a

(2, 1, 0) × (1, 3, 0)the rule, place by place(1×0 − 0×3, 0×1 − 2×0, 2×3 − 1×1)(0, 0, 5)
Both arrows lie flat with no depth, and the answer is pure depth: (0, 0, 5). Full lesson: The Vector Product

That length is |a| |b| sin θ. Half of it is the area of the triangle with the same two sides.

|b| sin θ|a|
Two vectors from one corner span a parallelogram: base |a|, height |b| sin θ. Full lesson: Parallelogram Area from the Vector Product
|b| sin θ|a|
The diagonal cuts it into two matching triangles, each one half of the area. Full lesson: Parallelogram Area from the Vector Product

See The vector product and Parallelogram area from the vector product.

How do you write the equation of a plane?

A plane is written from a point a and two directions b and c in it, as r = a + λb + μc, or from a point a and a normal n, a vector at right angles to the plane. For any point r in the plane, r − a lies in the plane, so (r − a) · n = 0, which rearranges to r · n = a · n; call that constant d. For the plane through (1, 2, 3) with normal (2, 1, −1), d is 1, since 2 + 2 − 3 = 1, so the plane is 2x + y − z = 1. The dot product is zero because the normal is perpendicular to every line in the plane. Given three points instead, find the normal first, as the cross product of two directions between them. Check the given point in the final equation: 2 × 1 + 2 − 3 = 1.

xyznr − an = (0.45, 0, 0.89), r · n = 1(r − a) · n = 0tiltd

tilt n and the plane tilts to stay perpendicular to it: every r − a lying in the plane has (r − a) · n = 0, so one normal fixes the plane's direction and d = 1 fixes which of the parallel planes it is

Make n vertical and set d = 1

Writing r as (x, y, z) opens the dot product out into ax + by + cz = d, and the coefficients are the components of the normal. The plane 2x + 3y + z = 7 has normal (2, 3, 1).

(x, y, z) · (2, 3, 1) = 7the normal is sitting in the coefficients2x + 3y + z = 7
Write r as (x, y, z) and the dot product opens out into 2x + 3y + z = 7. Full lesson: The Cartesian Equation of a Plane

The angle between two planes is the angle between their normals.

two planes, normals and
each plane brings one normal
Two planes tilt apart by exactly the angle their two normals tilt apart. Full lesson: The Angle Between Two Planes

The angle between a line and a plane is 90° minus the angle between the line and the normal. Complementary angles swap cosine for sine, so sin θ = |d · n| ÷ (|d| |n|). The common mistake is to stop at cos θ, which is the angle to the normal.

angle to the plane + angle to the normal = 90°θ to the plane, φ to the normal
A normal stands at right angles to its plane, so the two angles always add to 90°. Full lesson: The Angle Between a Line and a Plane

See The vector equation of a plane, The Cartesian equation of a plane, The angle between two planes and The angle between a line and a plane.

How do you find where things meet, and how far apart they are?

To find where a line meets a plane, write the line's x, y and z in terms of t, substitute them into the plane's equation, solve for t, and put that t back into the line. For r = (1, 0, 2) + t(1, 1, 1) and the plane x + y + z = 9, substituting gives (1 + t) + t + (2 + t) = 9, so 3t = 6, t = 2, and the point is (3, 2, 4). Substituting works because the meeting point is the one point of the line that satisfies the plane. If the t terms cancel, the line is parallel: it misses the plane when the leftover equation is false, and lies in it when that is true. A distance runs along the normal: substitute the point into the left side, subtract the constant, take the size, and divide by the normal's length |n|. Check the meeting point: 3 + 2 + 4 = 9.

y = x + 1(2, 3)y = 2x − 1x = 2, y = 3−4−4−2−22244

m₁ ≠ m₂: the two lines share exactly one point, and its coordinates are the one pair (x, y) that satisfies both equations

Make the gradients equal with different intercepts

t = 2r = (1, 0, 2) + 2(1, 1, 1)check: 6 + 2 + 4 = 12r = (3, 2, 4)
Solve for t, then put it back into the line to find the meeting point. Full lesson: The Intersection of a Line and a Plane

Two planes that are not parallel meet along a line. The line lies in both planes, so its direction is the cross product of the two normals. For a point on it, set z = 0 and solve the two plane equations for x and y.

the line lies in both planesso it is perpendicular to both normalsthe direction(1, 1, 1) × (1, 2, 3) = (1, −2, 1)
The line is perpendicular to both normals, so the cross product gives its direction. Full lesson: The Intersection of Two Planes

For the point (1, 1, 1) and the plane 2x + y + 2z = 14, the normal has length 3, and |2 + 1 + 2 − 14| ÷ 3 = 3.

perpendicularanother route
Any other route to the plane is a hypotenuse, so the perpendicular is shortest. Full lesson: The Distance from a Point to a Plane

See The intersection of a line and a plane, The intersection of two planes and The distance from a point to a plane.

Now you

(6, 6, 4) − (2, 1, 2)one stride back along the normal

P is (6, 6, 4) and sits 3 from a plane with normal (2, 1, 2), which has length 3. Where is the foot of the perpendicular?

perpendicularanother route

Which direction gives the shortest route from a point to a plane?

How do vectors describe motion?

An object that starts at position r₀ and moves with constant velocity v has position r = r₀ + v t after time t. The speed is the magnitude of v. A boat that starts at (2, 1) km with velocity (3, 4) km/h is at (8, 9) after 2 hours, since 2 + 3 × 2 = 8 and 1 + 4 × 2 = 9, and its speed is 5 km/h, the length of (3, 4). This is the vector equation of a line with time as the parameter, because each hour adds one copy of v. Meeting problems change the steps: two objects collide only if their positions are equal at the same time, so solve one component for t and test that t in the other. Check the distance covered: 2 hours at 5 km/h is 2 × 5 = 10 km, and |(6, 8)| is 10, because 36 + 64 = 100.

t = 0t = 1t = 2r(1) = (1, 1) + 1(4, 3) = (5, 4)|v| = √(4² + 3²) = 5 m/st

v = (4, 3): each second adds one copy of v to the position, so the dots are equal steps along a line, and the speed is |v| = 5, the length of the arrow

Turn v to (−3, 4) and read the speed

xyt = 0t = 1t = 2
Add v again for each second that passes. The positions lie on one straight line. Full lesson: Position and Velocity as Vectors

In three dimensions the same t must satisfy all three components.

xyABpaths cross
These two straight paths cross. That is a fact about the routes, not about the objects on them. Full lesson: Meeting Points and Travel Times

For the closest approach, subtract one position vector from the other to get the gap as a vector in t. The square of its length is a quadratic in t. Differentiate, set the derivative to 0 to find t, then take the square root for the distance.

xyclosest
The curve turns once. That turning point is the moment the two are nearest. Full lesson: The Closest Approach of Two Objects

When the velocity varies, differentiate the position vector coordinate by coordinate for the velocity, and again for the acceleration. An object that sets off k seconds later has position r(t − k).

See Position and velocity as vectors, Meeting points and travel times, The closest approach of two objects, Velocity that varies with time and Motion that starts later.

The mistakes worth naming

Lines, angles and Pythagoras covers the right triangle behind the magnitude formula, matrices and determinants write the same geometry another way, and triangle trigonometry and bearings solves the same problems without vectors. Related guides: Partial Differentiation.

Your turn

Three to try — tap what you get.

(2, 3) + (4, −1)

3 × (1, −2)

The magnitude of (3, 4)

Questions and answers

What is the difference between a vector and a scalar?
A scalar is a size on its own, like 5 meters or 3 kilograms. A vector is a size together with a direction, like 5 meters north-east. The practical consequence is that vectors do not add like numbers: walking 3 km east then 4 km north leaves you 5 km from where you started, not 7 km, because the directions disagree.
How do you add two vectors?
Add the components separately. In column form, add the top numbers to get the top of the answer and the bottom numbers to get the bottom. Geometrically this is the triangle rule: draw the first vector, start the second one where the first finished, and the sum is the single arrow from the very start to the very end.
What does the dot product tell you?
It measures how much two vectors point the same way. The dot product equals the product of the two magnitudes times the cosine of the angle between them, so it is largest when they are parallel, zero when they are perpendicular, and negative when they point roughly opposite ways. A dot product of zero is the standard test for a right angle in space.
What is the difference between the dot product and the cross product?
The dot product of two vectors is a number and the cross product is a vector. The dot product measures alignment and is used for angles and projections. The cross product produces a vector perpendicular to both inputs, whose length equals the area of the parallelogram they span, which makes it the tool for normals to planes and for areas in three dimensions.
How do you find the equation of a plane?
Find a vector perpendicular to the plane, called the normal, and one point that lies on it. If the normal is n and the known point has position vector a, then every point r on the plane satisfies r dotted with n equals a dotted with n. Written out in coordinates this becomes the familiar form ax + by + cz = d, where a, b and c are the components of the normal.
How do you find the shortest distance from a point to a plane?
Measure along the normal, because the shortest route from a point to a plane is always perpendicular to it. Substitute the point into the left-hand side of the plane equation, subtract the right-hand side, take the size of the result, and divide by the length of the normal vector. The division is what converts the answer from normal-lengths into ordinary distance.
Mr. Chalk