← Back to calculus 3

Lines and Planes

Lines in 3D

Why a point and a direction determine a line

In 2D you have already seen this idea. The slope-intercept form

y=ax+by = ax + b

encodes exactly two pieces of information:

Try the illustration below. The blue dot lives on the yy-axis at (0,b)(0, b) — drag it up or down to change the intercept while the slope stays fixed. The green dot sits on the line at x=3.5x = 3.5 — drag it up or down to rotate the line while the intercept stays fixed.

y = ax + b — drag to change intercept (blue) or slope (green)

y = 1x + 0b = 0a = 1 (slope = tan θ)
—— current line (y = ax + b)- - - parallel family (same slope, different b)

💡 Drag the blue dot to slide the intercept · drag the green dot to rotate the line.

xybO(rotate)(0, b)

Notice what happens when you drag only the blue dot: the line translates vertically — and the four dashed lines (same slope, different intercepts) show the entire parallel family that shares the same direction. Every one of them has slope aa; they are all valid if you only know the direction. Adding bb — fixing the yy-intercept — singles out exactly one line from this parallel family.

Conversely, if you drag only the green dot, the line rotates around the fixed intercept (0,b)(0, b): all lines through a single point but with different slopes. The point alone is not enough; you need the direction too.

Change either ingredient and you get a different line. These two pieces of data — a point and a direction — are the minimal recipe for a line in any dimension.

In 3D, a slope no longer makes sense as a single number, but a direction vector v\vec{v} plays the same role. The yy-intercept generalises to an arbitrary known point r0\vec{r}_0 on the line.


Vector equation of a line

Let r0\vec{r}_0 be the position vector of a known point on the line, and let v\vec{v} be the direction vector of the line. Every point on the line can be reached by starting at r0\vec{r}_0 and walking some multiple of v\vec{v}:

r(t)=r0+tv,tR.\boxed{\vec{r}(t) = \vec{r}_0 + t\,\vec{v}, \quad t \in \mathbb{R}.}

The graph below shows r0\vec{r}_0 (blue arrow from the origin) and v\vec{v} (green arrow, starting from the tip of r0\vec{r}_0). The grey dashed line is the full line generated by the equation. Drag either handle to explore.

r(t) = r₀ + tv — drag r₀ (blue) and v (green)

r₀ = (1, 2)v = (3, 1)
r(t) = (1, 2) + t·(3, 1)

💡 Drag the blue circle (tip of r₀) or green circle (tip of v) to adjust.

xyr₀vO

Parametric form: eliminating the parameter

The equation r(t)=r0+tv\vec{r}(t) = \vec{r}_0 + t\,\vec{v} is itself a parametric equation — it uses a parameter tt to trace out a curve (see parametric curves for the general idea).

Writing r0=(x0,y0,z0)\vec{r}_0 = (x_0,y_0,z_0) and v=(a,b,c)\vec{v} = (a,b,c), the vector equation expands component-wise to

{x=x0+aty=y0+btz=z0+ct.\begin{cases} x = x_0 + at \\ y = y_0 + bt \\ z = z_0 + ct. \end{cases}

These are the parametric equations of the line in 3D.

Symmetric equations (no parameter)

If a,b,ca, b, c are all nonzero, we can solve each equation for tt and set them equal:

xx0a=yy0b=zz0c.\frac{x - x_0}{a} = \frac{y - y_0}{b} = \frac{z - z_0}{c}.

These are the symmetric equations of the line. They eliminate the parameter tt entirely.

Find the parametric and symmetric equations of the line through P0=(2,1,3)P_0 = (2, -1, 3) with direction v=(4,1,2)\vec{v} = (4, 1, -2).

Parametric equations:

x=2+4t,y=1+t,z=32t.x = 2 + 4t,\quad y = -1 + t,\quad z = 3 - 2t.

Symmetric equations:

x24=y+11=z32.\frac{x-2}{4} = \frac{y+1}{1} = \frac{z-3}{-2}.

Find the vector equation of the line through A=(1,0,2)A = (1,0,2) and B=(3,4,1)B = (3,4,-1).

Direction vector: v=BA=(2,4,3)\vec{v} = B - A = (2,4,-3).

Vector equation:

r(t)=(1,0,2)+t(2,4,3).\vec{r}(t) = (1,0,2) + t(2,4,-3).

At t=0t=0 we are at AA; at t=1t=1 we are at BB.


Line segments as linear combinations

Definition

The line r(t)=a+t(ba)\vec{r}(t) = \vec{a} + t(\vec{b}-\vec{a}) can be rewritten as

r(t)=(1t)a+tb.\vec{r}(t) = (1-t)\,\vec{a} + t\,\vec{b}.

This is a linear combination of a\vec{a} and b\vec{b} with weights (1t)(1-t) and tt.

When tt is restricted to [0,1][0,1], the weights are non-negative and sum to 1. The result is exactly the line segment from a\vec{a} to b\vec{b}.

Range of ttLocation
t=0t = 0at a\vec{a}
t=1t = 1at b\vec{b}
0<t<10 < t < 1between a\vec{a} and b\vec{b} (the segment)
t<0t < 0beyond a\vec{a}, away from b\vec{b}
t>1t > 1beyond b\vec{b}, away from a\vec{a}

The interactive graph below shows both vectors a\vec{a} and b\vec{b} from the origin. The colored line illustrates the different regions. Drag either vector to explore.

r(t) = (1−t)a + tb — segment and extensions

a = (3, 1)b = (-1, 3)
r(t) = (1−t)·a + t·b
— t < 0— 0 ≤ t ≤ 1 (segment)— t > 1

💡 Drag the blue circle (a) or red circle (b) to adjust.

xyabt=0t=1O

What value of tt gives the midpoint of the segment from a\vec{a} to b\vec{b}?

Answer: At t=12t = \tfrac{1}{2}:

r ⁣(12)=12a+12b=a+b2.\vec{r}\!\left(\tfrac{1}{2}\right) = \tfrac{1}{2}\,\vec{a} + \tfrac{1}{2}\,\vec{b} = \frac{\vec{a}+\vec{b}}{2}.

Show that Q=(2,1,0)Q = (2,1,0) lies on the segment from A=(0,0,0)A=(0,0,0) to B=(4,2,0)B=(4,2,0), and find the value of tt.

Answer: r(t)=t(4,2,0)=(4t,2t,0)\vec{r}(t) = t(4,2,0) = (4t,2t,0). Setting equal to (2,1,0)(2,1,0) gives t=12[0,1]t = \tfrac{1}{2} \in [0,1]. ✓


Planes in 3D

A point and a normal direction

Just as a line is determined by a point and a direction it runs along, a plane is determined by a point and a direction it is perpendicular to — the normal direction n\vec{n}.

The interactive graph below shows a plane (purple surface) together with its normal vector (red arrow). Adjust the inputs to see how changing the normal or the base point rotates and translates the plane.

A plane is determined by a point r₀ and a normal n


Equation of a plane

Let r0=(x0,y0,z0)\vec{r}_0 = (x_0,y_0,z_0) be a known point on the plane and n=(a,b,c)\vec{n} = (a,b,c) be a normal vector. A point r=(x,y,z)\vec{r} = (x,y,z) lies on the plane if and only if the vector rr0\vec{r} - \vec{r}_0 is perpendicular to n\vec{n}:

n(rr0)=0.\boxed{\vec{n} \cdot (\vec{r} - \vec{r}_0) = 0.}

Expanding to component form

a(xx0)+b(yy0)+c(zz0)=0.a(x-x_0) + b(y-y_0) + c(z-z_0) = 0.

Expanding and collecting the constant:

ax+by+cz+d=0,ax + by + cz + d = 0,

where d=(ax0+by0+cz0)d = -(ax_0 + by_0 + cz_0).

The coefficients (a,b,c)(a,b,c) of x,y,zx,y,z in this equation are exactly the normal vector of the plane.

Find the equation of the plane through P0=(1,2,1)P_0 = (1,2,-1) with normal n=(3,1,4)\vec{n} = (3,-1,4).

3(x1)+(1)(y2)+4(z+1)=0    3xy+4z+3=0.3(x-1) + (-1)(y-2) + 4(z+1) = 0 \implies 3x - y + 4z + 3 = 0.

What is the normal vector of the plane 2x5y+z=72x - 5y + z = 7?

Answer: n=(2,5,1)\vec{n} = (2,-5,1).


Finding the normal via cross product

When a plane is described by two vectors lying in it (e.g., by three points), the normal can be found using the cross product (see cross product):

n=u×v,\vec{n} = \vec{u} \times \vec{v},

where u\vec{u} and v\vec{v} are two non-parallel vectors in the plane.

Procedure given three points AA, BB, CC:

  1. Compute u=BA\vec{u} = B - A and v=CA\vec{v} = C - A.
  2. Compute n=u×v\vec{n} = \vec{u} \times \vec{v}.
  3. Use AA as the base point: n(rA)=0\vec{n} \cdot (\vec{r} - A) = 0.

Find the equation of the plane through A=(1,0,0)A=(1,0,0), B=(0,1,0)B=(0,1,0), C=(0,0,1)C=(0,0,1).

u=BA=(1,1,0)\vec{u} = B-A = (-1,1,0), v=CA=(1,0,1)\vec{v} = C-A = (-1,0,1).

n=u×v=ijk110101=(1,1,1).\vec{n} = \vec{u}\times\vec{v} = \begin{vmatrix}\vec{i}&\vec{j}&\vec{k}\\-1&1&0\\-1&0&1\end{vmatrix} = (1,1,1).1(x1)+1(y)+1(z)=0    x+y+z=1.1(x-1)+1(y)+1(z)=0 \implies x+y+z=1.

Find the plane through P=(2,0,1)P=(2,0,-1) that contains both u=(1,2,0)\vec{u}=(1,2,0) and v=(0,1,3)\vec{v}=(0,1,3).

n=u×v=(6,3,1).\vec{n}=\vec{u}\times\vec{v}=(6,-3,1).6(x2)3y+(z+1)=0    6x3y+z11=0.6(x-2)-3y+(z+1)=0 \implies 6x-3y+z-11=0.

Find the plane through P=(1,1,1)P=(1,1,1) perpendicular to the line r(t)=t(2,3,1)\vec{r}(t)=t(2,3,-1).

The direction of the line is v=(2,3,1)\vec{v}=(2,3,-1), which becomes the normal: n=(2,3,1)\vec{n}=(2,3,-1).

2(x1)+3(y1)(z1)=0    2x+3yz4=0.2(x-1)+3(y-1)-(z-1)=0 \implies 2x+3y-z-4=0.

Find the plane through P=(1,0,0)P=(1,0,0) containing the line x=t,  y=t,  z=2tx=t,\; y=t,\; z=2t.

Two vectors in the plane: direction of the line u=(1,1,2)\vec{u}=(1,1,2) and v=P(0,0,0)=(1,0,0)\vec{v}=P-(0,0,0)=(1,0,0).

n=u×v=(0,2,1).\vec{n}=\vec{u}\times\vec{v}=(0,2,-1).2yz=0.2y-z=0.

Find the plane through A=(2,1,1)A=(2,1,-1), B=(3,3,0)B=(3,3,0), C=(0,2,1)C=(0,2,1).

u=(1,2,1)\vec{u}=(1,2,1), v=(2,1,2)\vec{v}=(-2,1,2).

n=u×v=(3,4,5).\vec{n}=\vec{u}\times\vec{v}=(3,-4,5).3(x2)4(y1)+5(z+1)=0    3x4y+5z+3=0.3(x-2)-4(y-1)+5(z+1)=0 \implies 3x-4y+5z+3=0.

Distance from a point to a plane

Geometric setup

Given a plane and a point PP not on it, the distance from PP to the plane is the length of the perpendicular segment from PP to the plane.

The graph below illustrates this: the plane is fixed and the point PP (blue) is draggable. The red dashed segment shows the perpendicular distance. Drag inside the graph to move PP in the xyxy-direction; hold Shift to adjust the zz-coordinate.

Distance from point P to the plane

Plane: 0x + 1y + 2z = 0
P = (2, 3, 1)distance = 2.24

💡 Drag inside the 3D graph to move point P (xy-plane). Hold Shift to adjust z.


Distance formula via projection

We use scalar projection (see dot product for the projection formula).

Let QQ be any point on the plane and let b=PQ\vec{b} = P - Q. The distance from PP to the plane is the component of b\vec{b} along the unit normal n^=n/n\hat{n} = \vec{n}/|\vec{n}|:

distance=bn^=bnn.\text{distance} = |\,\vec{b} \cdot \hat{n}\,| = \frac{|\vec{b} \cdot \vec{n}|}{|\vec{n}|}.

This equals bcosθ|\vec{b}|\cos\theta — the perpendicular drop from PP to the plane.

Formula for the plane ax+by+cz+d=0ax + by + cz + d = 0

The normal is n=(a,b,c)\vec{n} = (a,b,c). For any point QQ on the plane, aQx+bQy+cQz+d=0aQ_x + bQ_y + cQ_z + d = 0, so

bn=a(x1Qx)+b(y1Qy)+c(z1Qz)=ax1+by1+cz1+d.\vec{b} \cdot \vec{n} = a(x_1 - Q_x) + b(y_1 - Q_y) + c(z_1 - Q_z) = ax_1 + by_1 + cz_1 + d.

Therefore:

distance from (x1,y1,z1) to ax+by+cz+d=0 = ax1+by1+cz1+da2+b2+c2.\boxed{ \text{distance from } (x_1,y_1,z_1) \text{ to } ax+by+cz+d=0 \ =\ \frac{|ax_1+by_1+cz_1+d|}{\sqrt{a^2+b^2+c^2}}. }

Find the distance from P=(1,2,3)P=(1,2,3) to the plane x2y+2z4=0x - 2y + 2z - 4 = 0.

distance=14+641+4+4=13.\text{distance} = \frac{|1 - 4 + 6 - 4|}{\sqrt{1+4+4}} = \frac{1}{3}.

Find the distance from the origin to the plane 3x+4y12=03x + 4y - 12 = 0.

distance=3(0)+4(0)129+16=125.\text{distance} = \frac{|3(0)+4(0)-12|}{\sqrt{9+16}} = \frac{12}{5}.

Find the distance between 2xy+2z=42x - y + 2z = 4 and 2xy+2z=22x - y + 2z = -2.

Pick any point on the first plane, say (2,0,0)(2,0,0). Plug into the second plane's equation: 2(2)0+2(0)+2=62(2)-0+2(0)+2=6.

distance=64+1+4=63=2.\text{distance} = \frac{|6|}{\sqrt{4+1+4}} = \frac{6}{3} = 2.

The plane x+2y+2z=kx + 2y + 2z = k is at distance 3 from (1,1,1)(1,1,1). Find kk.

1+2+2k3=3    5k=9    k=4 or k=14.\frac{|1+2+2-k|}{3} = 3 \implies |5-k| = 9 \implies k = -4 \text{ or } k = 14.