Advanced level

Vectors in the plane

A vector is a segment that knows where it leads: it has a length, a direction and a sense, and in the coordinate plane it is written as a pair of numbers. Adding vectors is adding those pairs, multiplying by a number stretches the arrow, and the length comes from the Pythagorean theorem.

Before you start

This topic builds on earlier ideas. Before you start, it's worth working through the lessons below — they'll make everything click:

Where this is used

Real situations where you count exactly the way this lesson teaches:

  • Navigation and a wind correction
    An aircraft flies at [180, 0] km/h relative to the air while the wind carries it by [0, 60] km/h. Its speed over the ground is the sum [180, 60], that is √(180² + 60²) ≈ 190 km/h on a heading offset from the course — and that offset is what the pilot corrects for.
  • Physics and the resultant of two forces
    Two ropes pull a crate with forces [90, 0] N and [0, 120] N. The resultant is [90, 120] N, of magnitude √(90² + 120²) = 150 N. Adding the magnitudes alone would give 210 N — 40% too much, because the forces do not pull the same way.
  • Graphics and a moving object
    An object in a game moves at [3, −1] pixels per frame. After 30 frames it has moved by 30 · [3, −1] = [90, −30], so from (50, 200) it arrives at (140, 170). Multiplying a vector by a number replaces thirty separate additions.
  • A robot and the path to its target
    A robot stands at (2, 3) and the charging station is at (10, 9). The displacement vector is [8, 6], its length √(8² + 6²) = 10 m, and at 0.5 m/s the trip takes 20 seconds. Direction and distance both come out of one subtraction of coordinates.
  • Sailing across a current
    A boat heads straight across at [0, 4] km/h while the current carries it at [3, 0] km/h. The resulting motion is [3, 4], of magnitude 5 km/h — across a 400 m river the boat lands 300 m downstream of the point it aimed at.

All formulas

  • Coordinates of a vector

    AB=[xBxA, yByA]\vec{AB} = [x_B - x_A,\ y_B - y_A]

    the end minus the start

  • Length of a vector

    v=x2+y2|\vec{v}| = \sqrt{x^2 + y^2}

    the Pythagorean theorem on the coordinates

  • Sum of two vectors

    u+v=[ux+vx, uy+vy]\vec{u} + \vec{v} = [u_x + v_x,\ u_y + v_y]

    add the matching coordinates

  • Difference of two vectors

    uv=[uxvx, uyvy]\vec{u} - \vec{v} = [u_x - v_x,\ u_y - v_y]

    the same as adding the opposite vector

  • Multiplication by a number

    kv=[kx, ky]k \cdot \vec{v} = [k x,\ k y]

    a negative k reverses the sense

  • Length after scaling

    kv=kv|k \cdot \vec{v}| = |k| \cdot |\vec{v}|

    scales by the absolute value

One number is not enough to describe a displacement: "5 metres" does not say which way. What is needed is an object carrying length, direction and sense at once — and that object is a vector, a directed segment.

The same idea already appeared in transformations: a translation of a figure is given by exactly such an arrow. This lesson gives that arrow its own arithmetic.

The coordinates of a vector

A vector from AA to BB has coordinates that are differences — the end minus the start:

AB=[xBxA, yByA]\vec{AB} = [x_B - x_A,\ y_B - y_A]

The order matters: BA\vec{BA} is the same segment with the opposite sense, so both of its coordinates have opposite signs.

Two vectors are equal when their coordinates are the same — no matter where on the plane they are drawn. A vector is therefore a description of a displacement, not a particular place.

Find the coordinates of the vector AB, where A(−1, 4) and B(5, 2).

The length of a vector

The coordinates of a vector are the legs of a right triangle, so its length comes from the Pythagorean theorem:

v=x2+y2|\vec{v}| = \sqrt{x^2 + y^2}

Signs do not affect it, because they end up squared: [3, 4][3,\ 4], [3, 4][-3,\ 4] and [3, 4][3,\ -4] all have length 55. The only vector of length zero is the zero vector 0=[0, 0]\vec{0} = [0,\ 0], and it is the only one with neither direction nor sense.

Adding vectors

Arithmetically this is the simplest operation in the lesson — add the matching coordinates:

u+v=[ux+vx, uy+vy]\vec{u} + \vec{v} = [u_x + v_x,\ u_y + v_y]

Geometrically it is the triangle rule: put the second vector at the tip of the first, and the sum runs from the start of the first to the end of the second.

−1012345678−10123456u = [4, 1]v = [2, 4]u + v = [6, 5]u = [4, 1]v = [2, 4]u + v = [6, 5]
The triangle rule. The vector v drawn from the tip of u reaches the same point as the sum u + v drawn from the origin.

The same result comes from the parallelogram rule: draw both vectors from one point and build a parallelogram on them — the sum is its diagonal.

Subtraction is addition of the opposite vector:

uv=u+(v)=[uxvx, uyvy]\vec{u} - \vec{v} = \vec{u} + (-\vec{v}) = [u_x - v_x,\ u_y - v_y]
Compute [5, −2] + [−3, 6] and [5, −2] − [−3, 6].

Multiplying by a number

Multiplying a vector by a number kk (a scalar) stretches the arrow without changing the line it lies on:

kv=[kx, ky],kv=kvk \cdot \vec{v} = [k x,\ k y], \qquad |k \cdot \vec{v}| = |k| \cdot |\vec{v}|
−5−4−3−2−101234567−3−2−1012345u = [3, 2]2u = [6, 4]−u = [−3, −2]u = [3, 2]2u = [6, 4]−u = [−3, −2]
The vector 2u is twice as long as u and points the same way. The vector −u lies on the same line but points the other way.
Multiplier kkDirectionSenseLength
k>1k > 1unchangedunchangedgrows
0<k<10 < k < 1unchangedunchangedshrinks
k<0k < 0unchangedreversedscaled by the absolute value of kk
k=0k = 0zero

Hence a convenient test: two non-zero vectors are parallel exactly when one is a multiple of the other. [2, 3][2,\ 3] and [6, 9][6,\ 9] are parallel, because the second is three times the first; [2, 3][2,\ 3] and [6, 8][6,\ 8] are not.

Given u = [4, −6], compute −1.5 · u and its length.

Practice

Work through a set of exercises — they get harder as you go. At the end you'll see your score and the mistakes worth reviewing.

Exercise 1 of 8Score: 0
coordinates of the vector: A(4, −4), B(−1, −9)

Common mistakes

  • Subtracting "start minus end" — the coordinates of a vector are the end minus the start; the other order gives the opposite vector.
  • Adding lengths instead of vectorsu+v|\vec{u}| + |\vec{v}| is generally not u+v|\vec{u} + \vec{v}|; they agree only for vectors pointing the same way.
  • Treating a vector as tied to a place — two vectors with the same coordinates are equal wherever they are drawn.
  • Scaling only one coordinate — both are multiplied, otherwise the direction changes too.
  • Losing the sign with a negative multiplier — the length scales by k|k|, but the sense reverses.
  • Giving the zero vector a direction0\vec{0} has neither direction nor sense.

Formula card

Topic: Vectors in the plane

  • Coordinates of a vector

    AB=[xBxA, yByA]\vec{AB} = [x_B - x_A,\ y_B - y_A]

    the end minus the start

  • Length of a vector

    v=x2+y2|\vec{v}| = \sqrt{x^2 + y^2}

    the Pythagorean theorem on the coordinates

  • Sum of two vectors

    u+v=[ux+vx, uy+vy]\vec{u} + \vec{v} = [u_x + v_x,\ u_y + v_y]

    add the matching coordinates

  • Difference of two vectors

    uv=[uxvx, uyvy]\vec{u} - \vec{v} = [u_x - v_x,\ u_y - v_y]

    the same as adding the opposite vector

  • Multiplication by a number

    kv=[kx, ky]k \cdot \vec{v} = [k x,\ k y]

    a negative k reverses the sense

  • Length after scaling

    kv=kv|k \cdot \vec{v}| = |k| \cdot |\vec{v}|

    scales by the absolute value

−1012345678−10123456u = [4, 1]v = [2, 4]u + v = [6, 5]u = [4, 1]v = [2, 4]u + v = [6, 5]
Adding by the triangle rule: v starts at the tip of u, and the sum runs from the start of u to the end of v.
−5−4−3−2−101234567−3−2−1012345u = [3, 2]2u = [6, 4]−u = [−3, −2]u = [3, 2]2u = [6, 4]−u = [−3, −2]
Multiplying by a number: 2u is twice as long with the same sense, while −u keeps the direction and reverses the sense.

Frequently asked questions

Related articles