13  Lines and Planes

SageMath Spotlight

  • Implicit plotting (for planes)
    • implicit_plot3d
  • Parametric curves (for lines)
    • parametric_plot3d

Equipped with the dot and cross products for vectors in \(\mathbb{R}^3\), we can begin a more systematic approach to analytic geometry in terms of notions like direction and orthogonality.

13.1 Equations of Planes

In \(\mathbb{R}^3\), we can determine a plane in terms of its orientation in space and, in some vague sense, where it is anchored. More concretely, we can describe a plane by defining a single vector that points perpendicular to it (a normal vector, denoted \(\vec{n}\)), and a point \(\vec{r}_0\) on the plane.

Planes Through the Origin

We begin by studying planes defined by equations of the form

\[ ax+by+cz=0. \tag{13.1}\]

In particular, note that such a plane always contains the origin \((x,y,z) = (0,0,0)\)! Indeed, the coefficients \(a\), \(b\), and \(c\) turn out to describe a normal direction to the plane being described.

We can rewrite Equation 13.1 as \[ \langle a,b,c \rangle \cdot \langle x,y,z \rangle = 0. \] As we have seen in Chapter 11, two vectors are orthogonal if and only if their dot product is zero, and so any point \((x,y,z)\) on this plane is orthogonal to the vector \(\langle a, b, c \rangle\).

The equation \(ax+by+cz=0\) defines a plane through the origin normal to \(\vec{n} = \langle a, b, c \rangle\).

General Planes

For planes which do not pass through the origin, but contain some other point—say, \(P_0(x_0, y_0, z_0)\)—the underlying notions are the same. If we write \(\vec{r}_0\) for the position vector of \(P_0\), and let \(\vec{r}\) be the position vector of any other point \(P(x,y,z)\) on the plane, then the vector connecting them (\(\vec{r} - \vec{r}_0\)) lies entirely flat on the plane.

This displacement vector, then, must be orthogonal to the normal vector \(\vec{n} = \langle a, b, c \rangle\): \[ \vec{n} \cdot (\vec{r} - \vec{r}_0) = 0. \] Expanding this out gives us the scalar equation of a plane: \[ a(x - x_0) + b(y - y_0) + c(z - z_0) = 0. \] Notice that if we distribute the constants and group the constant terms on the right side, we get a general linear equation of the form \(ax + by + cz = d\). In particular, any such equation defines a plane and we can read off a normal vector \(\vec{n} = \langle a, b, c \rangle\) directly from the coefficients of \(x\), \(y\), and \(z\)!

Example 13.1 Consider the plane through the origin containing the vectors \(\vec{u} = \langle 1, 2, -1 \rangle\) and \(\vec{v} = \langle 2, -1, 3 \rangle\). To write an equation for this plane, we need a normal vector. Since \(\vec{u}\) and \(\vec{v}\) lie in the plane, their cross product will give us a vector orthogonal to both: \[ \vec{n} = \vec{u} \times \vec{v} = \begin{vmatrix} \mathbf{i}& \mathbf{j}& \mathbf{k}\\ 1 & 2 & -1 \\ 2 & -1 & 3 \end{vmatrix} = \langle 6 - 1, - (3 - (-2)), -1 - 4 \rangle = \langle 5, -5, -5 \rangle. \] Since the plane passes through the origin \((0,0,0)\), its equation is: \[ 5x - 5y - 5z = 0. \] Note that any scaling of this equation, such as \(x-y-z=0\), defines the same plane (since the vector \(\langle 1,-1,-1 \rangle\) is parallel to \(\langle 5,-5,-5 \rangle\)).

Example 13.2 We can determine a plane given three points on it. For example, consider the plane containing the points \(P(1, 0, 0)\), \(Q(0, 2, 0)\), and \(R(0, 0, 3)\).

We need a point on the plane (we have three to choose from!) and a normal vector. We can generate two vectors that lie in the plane by connecting the points: \[ \overrightarrow{PQ} = \langle -1, 2, 0 \rangle \quad \text{and} \quad \overrightarrow{PR} = \langle -1, 0, 3 \rangle. \] Taking their cross product gives the normal vector \(\vec{n}\): \[ \vec{n} = \overrightarrow{PQ} \times \overrightarrow{PR} = \begin{vmatrix} \mathbf{i}& \mathbf{j}& \mathbf{k}\\ -1 & 2 & 0 \\ -1 & 0 & 3 \end{vmatrix} = \langle 6, 3, 2 \rangle. \]

Using \(P(1,0,0)\) as our anchor point (though \(Q\) and \(R\) work, too), the equation of the plane is:

\[ 6(x - 1) + 3(y - 0) + 2(z - 0) = 0 \implies 6x + 3y + 2z = 6 \]

Distance from a Point to a Plane

We can synthesize these geometric tools to solve complex problems without memorizing formulas. For instance, what is the shortest distance from a point to a plane?

Example 13.3 Consider the point \(S(2, 3, 4)\) and the plane \(2x - y + 2z = 4\). The shortest path is strictly perpendicular to the plane. We also know the normal direction from the plane’s equation: \(\vec{n} = \langle 2, -1, 2 \rangle\).

Next, we can find a point on the plane by guessing. In particular, notice that if \(y=0\) and \(z=0\), then \(2x = 4\), i.e., \(x=2\). Thus we have found that the point \(P(2, 0, 0)\) lies on our plane. The vector connecting the plane to our point in space is \(\overrightarrow{PS} = \langle 0, 3, 4 \rangle\).

The distance we want is simply the length of the “shadow” that \(\overrightarrow{PS}\) casts in the direction of the normal vector \(\vec{n}\). In other words, we just need the absolute value of the scalar projection (the component) of \(\overrightarrow{PS}\) onto \(\vec{n}\):

\[ D = \left\vert{\operatorname{comp}_{\vec{n}}\left(\overrightarrow{PS}\right)}\right\vert = \frac{\vert{\vec{n} \cdot \overrightarrow{PS}}\vert}{\left\lVert \vec{n} \right\rVert}. \]

Plugging in our vectors gives:

\[ D = \frac{\vert{(2)(0) + (-1)(3) + (2)(4)}\vert}{\sqrt{2^2 + (-1)^2 + 2^2}} = \frac{\vert{5}\vert}{\sqrt{9}} = \frac{5}{3}. \]

13.2 Equations of Lines

Unlike planes, lines cannot be described by a single scalar equation in \(\mathbb{R}^3\). Instead, we describe a line by starting at a known point and tracing out a path using a direction vector (Stewart et al. 2020, 12.5, pp. 865).

Parametric Equations

To define a line, we need either:

  • An initial point \(P_0(x_0, y_0, z_0)\) and a direction vector \(\vec{v} = \langle a, b, c \rangle\), OR
  • Two distinct points \(P(x_0, y_0, z_0)\) and \(Q(x_1, y_1, z_1)\).

The latter gives rise to the former by taking \(\vec{v} = \overline{PQ}\) and \(P_0=P\), so we will restrict to the first case.

Let \(\vec{r}_0\) be the position vector for \(P_0\). To reach any other point on the line, we start at \(\vec{r}_0\) and travel some scalar amount \(t\) along the direction of \(\vec{v}\). This gives us the parametric vector equation of a line: \[ \vec{r}(t) = \vec{r}_0 + t \vec{v}. \] Breaking this down into its individual components gives the parametric scalar equations: \[ \begin{aligned} x(t) &= x_0 + at \\ y(t) &= y_0 + bt \\ z(t) &= z_0 + ct. \end{aligned} \]

Example 13.4 Consider the points \(P(-1,1,-2)\) and \(Q(3,2,1)\). In order to describe the line through \(P\) and \(Q\), we can choose \(\vec{v} = \overline{PQ}\) as our direction vector: \[ \vec{v} = \langle 3-(-1), 2-1, 1-(-2) \rangle = \langle 4, 1, 3 \rangle. \] Then the parametric equation \[ \vec{r}(t) = \langle -1+4t, 1+t, -2+3t \rangle \] describes the line through \(P\) and \(Q\). We can plot this using Sage:

Non-Uniqueness of Parametrization

The parametric representation of a line is not unique! If we choose a different starting point on the line, or if we scale the direction vector (e.g., using \(2\vec{v}\) or \(-\vec{v}\)), our equations will look different, but they will still trace out the exact same line!

Symmetric Equations

If we assume that \(a, b, c\) are all non-zero, we can solve each of the parametric equations for the parameter \(t\): \[ t = \frac{x-x_0}{a} \qquad t = \frac{y-y_0}{b} \qquad t = \frac{z-z_0}{c}. \] Since all three expressions equal \(t\), we can chain them together to form the symmetric equations of a line (Stewart et al. 2020, 12.5, pp. 866): \[ \frac{x-x_0}{a} = \frac{y-y_0}{b} = \frac{z-z_0}{c}. \] In this form, it is easy to read the direction vector \(\langle a, b, c \rangle\) straight from the denominators. Geometrically, these equations can be paired in three ways (e.g., \(\frac{x-x_0}{a} = \frac{y-y_0}{b}\) and \(\frac{y-y_0}{b} = \frac{z-z_0}{c}\)). Each pair actually describes a plane, and the line is the intersection of any two of these planes.

Example 13.5 Consider the line from Example 13.4: we found the parametric equation \(\vec{r}(t) = \langle -1+4t, 1+t, -2+3t \rangle\). Rewriting this into symmetric form gives: \[ \frac{x+1}{4} = y-1 = \frac{z+2}{3}. \]

Intersecting and Skew Lines

In two dimensions, lines must either be parallel or intersect. In three dimensions, we have a third possibility (Stewart et al. 2020, 12.5, pp. 867):

Two lines in \(\mathbb{R}^3\) are called skew lines if they do not intersect and are not parallel.

Skew lines exist in different planes—much like an overpass and a highway running in different directions below it!

Example 13.6 Consider the following lines:

\[L_1: \vec{r}_1(t) = \langle 1+t, 2-t, 3t \rangle \quad \text{and} \quad L_2: \vec{r}_2(s) = \langle 2-s, 1+2s, 3+s \rangle\]

Note that we must use different parameters (\(t\) and \(s\)) because the “particles” tracing these lines might arrive at the intersection point at different times in their respective parametrizations.

To determine if these lines intersect, we set the coordinate functions equal to each other to look for a collision:

\[ \begin{aligned} 1 + t &= 2 - s \quad \implies t + s = 1 \\ 2 - t &= 1 + 2s \quad \implies t + 2s = 1 \end{aligned} \]

Solving this system of two equations, we subtract the first from the second to get \(s = 0\), which means \(t = 1\). To verify this isn’t a pair of skew lines, we must check if these values satisfy the \(z\)-coordinate equation:

\[ z_1(1) = 3(1) = 3 \quad \text{and} \quad z_2(0) = 3 + 0 = 3 \]

Since they match, the lines intersect! Plugging \(t=1\) into \(\vec{r}_1\) gives the intersection point \((2, 1, 3)\). If we had obtained an inconsistent system of equations (with an expression such as \(1 = 0\)), on the other hand, we would have concluded that the lines are skew.

13.3 Quadric Surfaces and Traces

While planes and lines are described by linear equations, we frequently encounter 3D shapes described by higher-degree equations: recall the quadric surfaces of Section 10.1.3. A useful approach towards visualizing surfaces in \(\mathbb{R}^3\) is by slicing them with planes (usually parallel to the coordinate planes, like \(z=0\), \(x=1\), etc.) and observing the resulting 2D cross-sections. The textbook refers to these intersections as traces (Stewart et al. 2020, 12.6, pp. 875).

Example 13.7 (The cone, \(z^2 = x^2 + y^2\)) If we slice along a horizontal plane \(z = c\), we obtain equations of the form \(x^2 + y^2 = c^2\), which are circles of radius \(\vert{}c\vert{}\). On the other hand, if we look at vertical traces, we see very different sections! When \(y=0\), we have \(z^2 = x^2 \implies z = \pm x\), which is two intersecting lines forming a cross; when \(y=1\), we have \(z^2 = x^2 + 1\), which is a hyperbola opening upwards and downwards.

Example 13.8 (The sphere, \(x^2 + y^2 + z^2 = r^2\)) If we take a horizontal trace by setting \(z = c\) (where \(-r < c < r\)), the equation becomes \(x^2 + y^2 = r^2 - c^2\), which again is the equation of a circle (though its radius is not as simply defined). By taking traces in the \(x, y,\) and \(z\) directions, we see circles from every angle, bounding a sphere of radius \(r\). On the other hand, if \(\vert{}c\vert{} > r\), then the traces are empty—because we are cutting beyond the edges of the sphere!