Vectors

What a vector is, how to find its coordinates and length, how to add, subtract and scale vectors, collinearity, the dot product and the angle between vectors — with pictures.

  • Grades 9…11
  • 22 min
  • 10 questions
  • Lesson 55 of 92

In this lesson you will learn

  • Find the coordinates and the length of a vector
  • Add, subtract and scale vectors, both with coordinates and in a drawing
  • Use the dot product to find an angle and to test for perpendicularity

A boat crosses the Kura river. Its engine pushes it straight across at 4 m/s. At the same time the current drags it downstream at 3 m/s. How fast does the boat really move? Not 4 + 3 = 7 m/s — 5 m/s. Look at the picture: the two motions add up, but not “side by side” — at an angle.

currentboat 4 m/scurrent 3 m/sreal velocity5 m/sbankbank
The boat’s velocity (violet) and the current (blue) are placed one after the other. The real velocity is the orange arrow from start to end: a 3-4-5 triangle, so 5 m/s.

A single number is not enough to describe velocity — where it points matters too. Quantities that have both a size and a direction (velocity, force, displacement) are shown by vectors. Quantities with only a size, such as mass and temperature, are ordinary numbers — they are called scalars.

What is a vector?

A vector is a segment with an arrowhead. One end of the arrow is the start, the other is the end. The length of the segment is the vector’s length (magnitude), and the way the arrow points is its direction. The vector drawn from point A to point B is written AB; for short, a vector may also get one letter: a.

ABaABaby hand: an arrow on topin this lesson: bold letters
By hand, a vector gets an arrow on top. In this lesson vectors are written in bold: AB, a; the length as |a|.
ABstartendABCDCD = ABsame length, same direction:equal vectors−ABsame length, opposite direction:opposite vector
Where a vector sits does not matter: CD is drawn elsewhere, but it has the same length and direction as AB, so it is equal to it. The red arrow is the opposite of AB: −AB = BA.

VectorDefinition

A directed segment: it has a start, an end, a length (magnitude) and a direction. Vectors with equal lengths and the same direction are equal. Vectors lying on one line or on parallel lines are collinear. A vector of the same length but opposite direction is the opposite vector.

Simple explanation

Think of a vector as an instruction: “go 3 steps right and 4 steps up”. Where you start does not matter — from home or from school, the instruction is the same. That is why arrows of the same length pointing the same way are the same vector, wherever they are drawn.

Sign up free to keep reading

The rest of the lesson, the quiz and your notes open with an Educora account. Signing up takes a minute, and your progress is saved on all your devices.

Coordinates and length of a vector

To write a vector with numbers we use its coordinates: how many steps to the right and how many steps up take you from the start to the end? Those two numbers are the vector’s coordinates. Steps to the left or down are written as negative.

xy0123451234567AB4 − 1 = 35 − 1 = 45A(1, 1) → B(4, 5)AB = (3, 4)|AB| = √(3² + 4²) = 5
From A to B: 3 steps right, 4 steps up, so AB = (3, 4). The vector is the hypotenuse of a right triangle, so its length comes from Pythagoras: √(3² + 4²) = 5.
AB = (x₂ − x₁, y₂ − y₁)

Where

A(x₁, y₁)
the start of the vector
B(x₂, y₂)
the end of the vector
x₂ − x₁
how many steps right (negative: left)
y₂ − y₁
how many steps up (negative: down)

Remember: end minus start — subtract the coordinates of the start from those of the end.

|a| = √(x² + y²)

Where

|a|
the length (magnitude) of the vector — never negative
x, y
the coordinates of the vector

This is the Pythagorean theorem: x and y are the legs, the vector is the hypotenuse. In space a third coordinate is added: √(x² + y² + z²).

Simple explanation

Coordinates and length

Problem

Points A(1, −2) and B(4, 2) are given. Find the coordinates and the length of AB.

Show solutionHide solution

Solution

1) End minus start: x = 4 − 1 = 3.
2) y = 2 − (−2) = 4.
3) AB = (3, 4).
4) Length: |AB| = √(3² + 4²) = √(9 + 16) = √25 = 5.
This is also the distance between the points A and B.

Adding and subtracting vectors

Adding two vectors means walking two paths one after the other. First you walk along the first vector; from where you stop you continue along the second. The sum is the arrow from the very start to the very end. In the picture we go from A to B, then from B to C; in the end we have arrived at C from A.

ABCABfirst this wayBCthen this wayAC = AB + BCsum: straight from A to C
Triangle rule: put the start of the second vector at the end of the first; the sum goes from the start of the first to the end of the second. In letters: AB + BC = AC — the middle letter B “cancels”.

When two vectors start at the same point, the parallelogram rule is handy: build a parallelogram on the two vectors. The diagonal from the common start is the sum. The other diagonal is the difference — it points from the end of the subtracted vector to the end of the first one.

Oaba + ba − ba + b — the diagonal from the common starta − b — from the end of b to the end of acopies of a and b moved over
Parallelogram rule. Orange diagonal: a + b. Red diagonal: a − b (from the end of b to the end of a). Check: b + (a − b) = a — walk the green arrow, then the red one, and you reach the end of a.

With coordinates, adding and subtracting is even easier: add or subtract the matching coordinates. Steps to the right add up with steps to the right, steps up with steps up.

a + b = (x₁ + x₂, y₁ + y₂)a − b = (x₁ − x₂, y₁ − y₂)

Where

a = (x₁, y₁)
the first vector
b = (x₂, y₂)
the second vector
Simple explanation

For example, (3, 1) + (1, 2) = (4, 3): 3 steps right and 1 more make 4 steps right; 1 step up and 2 more make 3 steps up. Subtraction works the same way: (3, 1) − (1, 2) = (2, −1).

Multiplying a vector by a number means stretching or shrinking it. 2a points the same way as a but is twice as long. ½a is half as long. Multiplying by a negative number turns the vector around: −a has the same length but the opposite direction.

alength |a|2atwice as long, same direction½ahalf as long−asame length, opposite direction
The length of k · a is |k| · |a|. For k > 0 the direction is the same, for k < 0 it is reversed.
k · a = (k · x, k · y)

Where

k
a number (scalar)
a = (x, y)
the vector being multiplied
|k · a| = |k| · |a|
the new length

Operations in coordinates

Problem

a = (2, −1), b = (−3, 4). Find the vector 2a − b and its length.

Show solutionHide solution

Solution

1) Multiply first: 2a = (2 · 2, 2 · (−1)) = (4, −2).
2) Then subtract coordinate by coordinate: 2a − b = (4 − (−3), −2 − 4) = (7, −6).
3) Length: |2a − b| = √(7² + (−6)²) = √(49 + 36) = √85 ≈ 9.22.
Going deeper

Vectors turn many geometry theorems into one line of arithmetic. Let M and N be the midpoints of the sides AB and BC of a triangle ABC. By the chain rule: MN = MB + BN = ½AB + ½BC = ½(AB + BC) = ½AC. So the midline MN is parallel to AC and half as long — the whole proof is one line.

ABCMNMN = ½ACAC — the base, MN is parallel to itM and N are the midpoints of AB and BC
The midline theorem with vectors: MN = MB + BN = ½AC.

Midpoints of a quadrilateral

Problem

Prove that the midpoints of the sides of any quadrilateral are the vertices of a parallelogram. Check it for A(0, 0), B(4, 0), C(6, 4), D(0, 6).

Show solutionHide solution

Solution

1) Let P, Q, R, S be the midpoints of AB, BC, CD, DA.
2) In triangle ABC, PQ is a midline: PQ = ½AC.
3) In triangle ADC, SR is a midline: SR = ½AC.
4) So PQ = SR: two opposite sides are parallel and equal — PQRS is a parallelogram.
Check: P(2, 0), Q(5, 2), R(3, 5), S(0, 3). PQ = (3, 2), SR = (3, 2), ½AC = ½ · (6, 4) = (3, 2) ✓.

Collinear vectors

Two vectors are collinear — they lie on one line or on parallel lines — when one is a stretched, shrunk or reversed copy of the other: b = k · a. With coordinates this is easy to check: the coordinates must be proportional — however many times one coordinate grows, the other grows the same number of times.

a ∥ b ⇔ x₁ / x₂ = y₁ / y₂ ⇔ x₁ · y₂ − x₂ · y₁ = 0a ∥ b ⇔ x₁ / x₂ = y₁ / y₂ ⇔ x₁ · y₂ − x₂ · y₁ = 0

Where

a = (x₁, y₁)
the first vector
b = (x₂, y₂)
the second vector
x₁ · y₂ − x₂ · y₁
the “cross product”: zero means collinear (handier when a coordinate is 0)
Simple explanation

The collinearity condition

Problem

For which m is the vector c = (m, 3) collinear with a = (2, −1)?

Show solutionHide solution

Solution

1) The coordinates must be proportional: m / 2 = 3 / (−1).
2) 3 / (−1) = −3, so m / 2 = −3.
3) m = −6.
Check: c = (−6, 3) = −3 · (2, −1) — the vector c points opposite to a, but it is collinear.
Going deeper

The expression x₁y₂ − x₂y₁ has a geometric meaning: its absolute value is the area of the parallelogram built on a and b. Collinear vectors build a “flat” parallelogram of area 0 — that is why the condition works. At university this number is called the determinant of the 2 × 2 matrix of coordinates; in space the same idea gives the cross product.

The area of a triangle with vectors

Problem

Find the area of the triangle with vertices A(1, 1), B(4, 2), C(2, 5).

Show solutionHide solution

Solution

1) Two vectors from one vertex: AB = (3, 1), AC = (1, 4).
2) Area of the parallelogram: |3 · 4 − 1 · 1| = |12 − 1| = 11.
3) The triangle is half of it: S = 11 / 2 = 5.5.
No height and no Heron’s formula needed.

The dot product

Two vectors can be “multiplied” so that the result is a number, not a vector. This number tells how much the two arrows point the same way. If they point roughly the same way, the number is positive; if they are perpendicular, it is zero; if they point roughly opposite ways, it is negative. This is the dot product (also called the scalar product — “scalar” means a number).

abφacute angleφ < 90°a · b > 0abφright angleφ = 90°a · b = 0abφobtuse angleφ > 90°a · b < 0
The sign of the dot product tells the kind of angle: positive — acute, zero — right angle (perpendicular vectors), negative — obtuse.
a · b = |a| · |b| · cos φ

Where

a · b
the dot product — a number, not a vector
|a|, |b|
the lengths of the vectors
φ
the angle between the vectors, 0° ≤ φ ≤ 180° (draw them from one point and look at the angle between them)
a · b = x₁ · x₂ + y₁ · y₂

Where

a = (x₁, y₁)
the first vector
b = (x₂, y₂)
the second vector

To compute it from coordinates: multiply the matching coordinates and add. No angle needed.

cos φ = (x₁ · x₂ + y₁ · y₂) / (|a| · |b|)cos φ = (x₁ · x₂ + y₁ · y₂) / (|a| · |b|)

Where

cos φ
the cosine of the angle between the vectors; φ follows from it

Setting the two formulas equal and solving for cos φ: if the coordinates are known, the angle can be found.

Simple explanation

To compute it, multiply the matching coordinates and add: (1, 2) · (3, 1) = 1 · 3 + 2 · 1 = 5. Positive — so the angle is acute. (2, 1) · (−1, 2) = −2 + 2 = 0 — so these two vectors are perpendicular.

a ⊥ b ⇔ x₁ · x₂ + y₁ · y₂ = 0

Where

a ⊥ b
the vectors are perpendicular (the angle between them is 90°)

Because cos 90° = 0. This is the shortest way to test for perpendicularity.

The angle between vectors

Problem

Find the angle between a = (1, 2) and b = (3, 1).

Show solutionHide solution

Solution

1) Dot product: a · b = 1 · 3 + 2 · 1 = 5. Positive — the angle is acute.
2) Lengths: |a| = √(1 + 4) = √5, |b| = √(9 + 1) = √10.
3) cos φ = 5 / (√5 · √10) = 5 / √50 = 5 / (5√2) = √2 / 2.
4) φ = 45°.

Perpendicularity and work in physics

Problem

a) For which k are a = (k, 2) and b = (3, −6) perpendicular?
b) A force of 50 N moves a body 10 m; the angle between the force and the displacement is 60°. Find the work done by the force.

Show solutionHide solution

Solution

a) Perpendicular vectors have a dot product of 0:
1) a · b = k · 3 + 2 · (−6) = 3k − 12.
2) 3k − 12 = 0 ⇒ k = 4.
b) Work is the dot product of force and displacement:
1) W = F · s = F · s · cos φ.
2) W = 50 · 10 · cos 60° = 50 · 10 · 0.5 = 250 J.

Interactive

Loading simulation…
A vector of length 1 is a unit vector. The unit vector at angle φ to the x-axis has coordinates (cos φ, sin φ). Drag the angle and watch the coordinates change: any vector can be written as |a| · (cos φ, sin φ).
Going deeper
|a − b|² = |a|² + |b|² − 2 · a · b

Where

|a − b|
the length of the difference — the third side of the triangle

This is the law of cosines written with vectors: expand (a − b) · (a − b) and it appears. Put a · b = |a| · |b| · cos φ and you get the familiar c² = a² + b² − 2ab · cos φ.

|a · b| ≤ |a| · |b|

Where

|a · b|
the absolute value of the dot product

The Cauchy–Schwarz inequality: true because |cos φ| ≤ 1. Equality holds only for collinear vectors. It solves many “largest value” problems in one line.

A maximum with vectors

Problem

Given x² + y² = 1, find the largest and the smallest value of 3x + 4y.

Show solutionHide solution

Solution

1) 3x + 4y is the dot product of a = (3, 4) and b = (x, y).
2) |a| = √(9 + 16) = 5, |b| = √(x² + y²) = 1.
3) Cauchy–Schwarz: |3x + 4y| ≤ 5 · 1 = 5.
4) The largest value, 5, is reached when b points the same way as a: (x, y) = (3/5, 4/5). Check: 9/5 + 16/5 = 5 ✓.
5) The smallest value, −5, is reached at (x, y) = (−3/5, −4/5).
Without vectors this problem would need trigonometry or derivatives.

At university a vector is any ordered list of numbers — it may have 3, 100 or a million coordinates. Nobody can draw such a vector, yet the dot product and cos φ are computed in exactly the same way. Recommendation systems compare people’s tastes this way: the closer cos φ is to 1, the more similar the two lists are.

Tastes as vectors

Problem

Aysel, Murad and Leyla rated three films from 1 to 5: Aysel (5, 3, 4), Murad (4, 2, 5), Leyla (1, 5, 2). Whose taste is closer to Aysel’s?

Show solutionHide solution

Solution

1) Aysel and Murad: a · m = 5 · 4 + 3 · 2 + 4 · 5 = 46; |a| = √50, |m| = √45.
cos φ = 46 / √2250 ≈ 0.970 (φ ≈ 14°).
2) Aysel and Leyla: a · l = 5 + 15 + 8 = 28; |l| = √30.
cos φ = 28 / √1500 ≈ 0.723 (φ ≈ 44°).
3) Murad’s taste is closer: the angle between the rating vectors is much smaller.

Remember

  • A vector is an arrow with a length and a direction. AB = (x₂ − x₁, y₂ − y₁): “end minus start”. Length: |a| = √(x² + y²).
  • Addition — the triangle rule (paths one after the other) or the parallelogram rule; in coordinates, matching coordinates are added. k · a multiplies every coordinate by k.
  • Chain rule: AB + BC = AC; difference: AB − AC = CB.
  • a ∥ b ⇔ the coordinates are proportional (x₁y₂ − x₂y₁ = 0).
  • The dot product is a number: a · b = |a| · |b| · cos φ = x₁x₂ + y₁y₂. Its sign tells the kind of angle; a ⊥ b ⇔ a · b = 0.
Spotted a mistake or something inaccurate in this lesson?

Check yourself

10 questions. Every correct answer earns XP.

Question 1 / 10

Question 1 / 10. What is the distance between A(−1, 3) and B(5, −5)?