7. Vectors in 3-D Space

We saw earlier how to represent 2-dimensional vectors on the x-y plane.

Now we extend the idea to represent 3-dimensional vectors using the x-y-z axes. (See The 3-dimensional Co-ordinate System for background on this).


The vector OP has initial point at the origin O (0, 0, 0) and terminal point at P (2, 3, 5). We can draw the vector OP as follows:

3D vector

Magnitude of a 3-Dimensional Vector

We saw above that the distance between 2 points in 3-dimensional space is

`"distance"\ AB = ` `sqrt ((x_2-x_1)^2+ (y_2-y_1)^2+ (z_2-z_1)^2)`

For the vector OP above, the magnitude of the vector is given by:

`| OP | = sqrt(2^2+ 3^2+ 5^2) = 6.16\ "units" `

Continues below

Adding 3-dimensional Vectors

Earlier we saw how to add 2-dimensional vectors. We now extend the idea for 3-dimensional vectors.

We simply add the i components together, then the j components and finally, the k components.

Example 1

ship at anchor

Two anchors are holding a ship in place and their forces acting on the ship are represented by vectors A and B as follows:

A = 2i + 5j − 4k and B = −2i − 3j − 5k

If we were to replace the 2 anchors with 1 single anchor, what vector represents that single vector?

Dot Product of 3-dimensional Vectors

To find the dot product (or scalar product) of 3-dimensional vectors, we just extend the ideas from the dot product in 2 dimensions that we met earlier.

Example 2 - Dot Product Using Magnitude and Angle

Find the dot product of the vectors P and Q given that the angle between the two vectors is 35° and

| P | = 25 units and | Q | = 4 units

Example 3 - Dot Product if Vectors are Multiples of Unit Vectors

Find the dot product of the vectors A and B (these come from our anchor example above):

A = 2i + 5j − 4k and B = −2i − 3j − 5k

Direction Cosines

Suppose we have a vector OA with initial point at the origin and terminal point at A.

Suppose also that we have a unit vector in the same direction as OA. (Go here for a reminder on unit vectors).

Let our unit vector be:

u = u1 i + u2 j + u3 k

On the graph, u is the unit vector (in black) pointing in the same direction as vector OA, and i, j, and k (the unit vectors in the x-, y- and z-directions respectively) are marked in green.

unit vector

We now zoom in on the vector u, and change orientation slightly, as follows:


Now, if in the diagram above,

α is the angle between u and the x-axis (in dark red),
is the angle between u and the y-axis (in green) and
is the angle between u and the z-axis (in pink),

then we can use the scalar product and write:


= u `*` i

= 1 × 1 × cos α

= cos α


= u`*` j

= 1 × 1 × cos β

= cos β


= u `*` k

= 1 × 1 × cos γ

= cos γ

So we can write our unit vector u as:

u = cos α i + cos β j + cos γ k

These 3 cosines are called the direction cosines.

Angle Between 3-Dimensional Vectors

Earlier, we saw how to find the angle between 2-dimensional vectors. We use the same formula for 3-dimensional vectors:

`theta=arccos((P * Q)/(|P||Q|))`

Example 4

Find the angle between the vectors P = 4i + 0j + 7k and Q = -2i + j + 3k.


Find the angle between the vectors P = 3i + 4j − 7k and Q = -2i + j + 3k.


We have a cube ABCO PQRS which has a string along the cube's diagonal B to S and another along the other diagonal C to P

What is the angle between the 2 strings?