### (18) Writing the equation of a line
in 3 dimensions

The previous section shows how the equation 3x + 4y = 12 describes a line
in 2 dimensions but a plane in 3 dimensions.

So, how would we write the equation of a line in 3 dimensions in terms of
x, y and z?

To show you how the working goes, I'll take the particular example of the
line

whose vector equation is
**r** = **a** + t**b** with **a** = 2**i** + 3**j** -
4**k** and **b** = 3**i** - **j** + 2**k**.

Since **r** is standing for the position vector from O of any point on
the line

we'll write **r** = x**i** + y**j** + z**k**.

The x, y and z will vary as the point P moves on the line.

So now we can say

**r** = x**i** + y**j** + z**k** = 2**i** + 3**j** -
4**k** + t(3**i** - **j** + 2**k**).
It's particularly easy to see how the next step works, if we write this
equation using column vectors. (To do this, we write each set of
the **i**, **j**
and **k** components in a column.) This gives

Now, this equation can't be satisfied unless it is true for each separate
component.

This means that we really have *three* equations here. We have

x = 2 + 3t

y = 3 - t

z = - 4 + 2t

Rearranging each equation for t gives us

Therefore we can say

This is the equation of the line in terms of x, y and z (also called its
**cartesian equation**).

So, if x = 5 for example, we would have 1 = 3 - y so y = 2 and z + 4 = 2 so
z = -2.

The point with coordinates (5,2,-2) lies on this line.

Using the form

we can see that the position vector of this point is given when t = 1.

#### The general case

In general, if **a** = a_{1}**i** + a_{2}**j**
+ a_{3}**k** and
**b** = b_{1}**i** + b_{2}**j**
+ b_{3}**k** then the equation of the line
**r** = **a** + t**b** can also be written as

Rearranging as before, we get

which is the cartesian equation of the line.

You can see from this how the components of the position vector **a**
and the direction vector **b** appear in this equation.

Now we'll find the cartesian equation of the red line which lies in the
plane 3x + 4y = 12 from the previous section. This
will also show what happens to the working
when either **a** or **b** or both have components equal to zero.

Here's the picture again, with the line picked out on its own beside it.

I've chosen to work
with **a** = 3**j** and **b** = -4**i** + 3**j**
so **r** = 3**j** + t(-4**i** + 3**j**).

Taking **r** = x**i** + y**j** + x**k** as
before, and working with column vectors, gives us

From this, we get the three equations

x = - 4t

y = 3 + 3t

z = 0

Rearranging the first two equations gives

So the cartesian equation of this line is given by

So, if x = 8 for example, we have y - 3 = - 6 so y = - 3.

The point (8,-3,0) lies on this line.

Using the vector equation of the line

we can see that we get the position vector of this point when t = -2.

**Where next?**
or **back to the previous section**

or **back to the vectors homepage.**