Vectors

This is a vector:

Vector represented as a blue arrow

A vector has magnitude (size) and direction:

Vector arrow with length labeled magnitude and angle labeled direction

The length of the line shows its magnitude and the arrowhead points in the direction.

Play with one here:

../geometry/images/geom-vector.js?mode=vector

We can add two vectors by joining them head-to-tail:

Vectors a and b joined head-to-tail to show addition result a plus b

And it doesn't matter which order we add them, we get the same result:

Vectors b and a joined head-to-tail showing b plus a

Example: A plane is flying along, pointing North, but there's a wind coming from the North-West.

Airplane pointing North with a wind vector pushing from the North-West

The two vectors (the velocity caused by the propeller, and the velocity of the wind) result in a slightly slower ground speed heading a little East of North.

If you watched the plane from the ground it would seem to be slipping sideways a little.

Airplane flight path deflected eastward by wind

Have you ever seen that happen? Maybe you have seen birds struggling against a strong wind that seem to fly sideways. Vectors help explain that.

Velocity, acceleration, force and many other things are vectors.

Subtracting

We can also subtract one vector from another:

vector subtract a-b = a + (-b)
ab

Notation

A vector is often written in bold, like a or b.

A vector can also be written as the letters
of its head and tail with an arrow above it, like this:
  vector notation a=AB, head, tail

Calculations

Now ... how do we do the calculations?

The most common way is to first break up vectors into x and y parts, like this:

Vector a decomposed into horizontal component ax and vertical component ay

The vector a is broken up into
the two vectors ax and ay

(We see later how to do this.)

Adding Vectors

We can then add vectors by adding the x parts and adding the y parts:

Component addition of vectors (8, 13) and (26, 7) yielding (34, 20)

The vector (8, 13) and the vector (26, 7) add up to the vector (34, 20)

Example: add the vectors a = (8, 13) and b = (26, 7)

c = a + b

c = (8, 13) + (26, 7) = (8+26, 13+7) = (34, 20)

When we break up a vector like that, each part is called a component:

../geometry/images/geom-vector.js?mode=xy

Subtracting Vectors

To subtract, first reverse the vector we want to subtract, then add.

Example: subtract k = (4, 5) from v = (12, 2)

a = v + (−k)

a = (12, 2) + −(4, 5) = (12, 2) + (−4, −5) = (12−4, 2−5) = (8, −3)

Magnitude of a Vector

The magnitude of a vector is shown by two vertical bars on either side of the vector:

|a|

OR it can be written with double vertical bars (so as not to confuse it with absolute value):

||a||

We use Pythagoras' theorem to calculate it:

|a| = √( x2 + y2 )

Example: what's the magnitude of the vector b = (6, 8) ?

|b| = √( 62 + 82 ) = √(36+64) = √100 = 10

A vector with magnitude 1 is called a Unit Vector.

Vector vs Scalar

A scalar has magnitude (size) only.

Scalar: just a number (like 7 or −0.32) ... definitely not a vector.

A vector has magnitude and direction, and is often written in bold, so we know it isn't a scalar:

Example: kb is actually the scalar k times the vector b.

If k = 2 and b = (3, 4), then

kb = 2 × (3, 4) = (2×3, 2×4) = (6, 8)

Multiplying a Vector by a Scalar

When we multiply a vector by a scalar it is called "scaling" a vector, because we change how big or small the vector is.

Example: multiply the vector (5,2) by the scalar 3

Vector (5, 2) multiplied by 3 to produce vector (15, 6)

a = 3(5,2) = (3×5,3×2) = (15,6)

It still points in the same direction, but is 3 times longer

(And now you know why numbers are called "scalars", because they "scale" the vector up or down.)

Multiplying a Vector by a Vector (Dot Product and Cross Product)

Two vectors with angle theta between them

How do we multiply two vectors together? There's more than one way!

(Read those pages for more details.)

More Than 2 Dimensions

Vectors also work perfectly well in 3 or more dimensions:

Vector (1, 4, 5) plotted on 3D x, y, and z axes
The vector (1, 4, 5)

Example: add the vectors a = (3, 7, 4) and b = (2, 9, 11)

c = a + b

c = (3, 7, 4) + (2, 9, 11) = (3+2, 7+9, 4+11) = (5, 16, 15)

Example: what's the magnitude of the vector w = (1, −2, 3) ?

|w| = √( 12 + (−2)2 + 32 ) = √(1+4+9) = √14

Here's an example with 4 dimensions (but it is hard to draw!):

Example: subtract (1, 2, 3, 4) from (3, 3, 3, 3)

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

Magnitude and Direction

We may know a vector's magnitude and direction, but want its x and y lengths (or vice versa):

Vector in polar coordinates defined by length r and angle theta <=> Vector in Cartesian coordinates defined by horizontal x and vertical y lengths
Vector a in Polar
Coordinates
  Vector a in Cartesian
Coordinates

You can read how to convert them at Polar and Cartesian Coordinates, but here's a quick summary:

From Polar Coordinates (r,θ)
to Cartesian Coordinates (x, y)
  • x = r × cos( θ )
  • y = r × sin( θ )
From Cartesian Coordinates (x, y)
to Polar Coordinates (r,θ)
  • r = √ ( x2 + y2 )
  • θ = tan-1 ( y / x )
Note: special rules apply for tan-1 when x is negative, see Polar and Cartesian Coordinates

Two people, Sam and Alex, pulling a box at different angles

An Example

Sam and Alex are pulling a box.

What's the combined force, and its direction?

Let's add the two vectors head to tail:

Force vectors of 200 N at 60 degrees and 120 N at -45 degrees joined head-to-tail

First convert from polar to Cartesian (to 2 decimals):

Sam's Vector:

Alex's Vector:

(note that 45° below the horizontal is −45°)

Now we have:

Force vectors broken down into x and y component vectors

Add them:

(100,173.21) + (84.85, −84.85) = (184.85, 88.36)

That answer is valid, but let's convert back to polar as the question was in polar:

And we have this (rounded) result:
Resultant vector of magnitude 204.88 N at angle 25.5 degrees

And it looks like this for Sam and Alex:
Box pulled along combined vector force of 204.88 N at 25.5 degrees

They might get a better result if they were shoulder-to-shoulder!

3022,3023,3024,3025,3026,3027,3028,3901,3902,3029