Evanalysis
10.1Estimated reading time: 20 min

10.1 Lines, planes, projections, and distances

Describe affine lines and planes, prove shortest-distance formulas, and analyze intersections, angles, and projected lines with their exceptional cases.

Course contents

Motivation

A line requires both a location and a direction. A plane likewise requires a location, but its orientation is often specified by a perpendicular vector. The distinction determines which equations describe the object and which component of a displacement measures its distance from a point.

We identify a point with its position vector after choosing an origin. Differences of positions are displacements: if P,QP,Q have positions p,qp,q, then PQ=qp\overrightarrow{PQ}=q-p. Keeping this subtraction order explicit prevents a point coordinate from being confused with a direction vector. The norm and orthogonal projection developed in the previous chapter will turn geometric shortest-distance questions into exact algebraic calculations.

Lines and their equations

Definition

An affine line with a nonzero direction

Let nZ+n\in\mathbb Z^+, cRnc\in\mathbb R^n, and aRn{0}a\in\mathbb R^n\setminus\{\mathbf0\}. The line through cc in direction aa is

L={c+ta:tR}.L=\{c+ta:t\in\mathbb R\}.

Its coordinate equations are xi=ci+taix_i=c_i+ta_i for i=1,,ni=1,\ldots,n. The same real parameter tt must satisfy all coordinates simultaneously.

The restriction a0a\ne\mathbf0 ensures that the set is a line rather than a single point. Every point c+t0ac+t_0a can replace cc as the base point: c+ta=(c+t0a)+(tt0)ac+ta=(c+t_0a)+(t-t_0)a. Replacing aa by kaka, where k0k\ne0, also preserves the line because ktkt ranges through every real number. Neither the base point nor the direction vector is unique; the resulting set of points is what defines the line.

If every ai0a_i\ne0, eliminate the parameter to obtain

x1c1a1==xncnan.\frac{x_1-c_1}{a_1}=\cdots=\frac{x_n-c_n}{a_n}.

When ai=0a_i=0, its coordinate equation is instead xi=cix_i=c_i. Use ratios only for nonzero direction components. If there is just one such component, that coordinate is free and every other coordinate is fixed. Parameter form works uniformly in all of these cases, without dividing by a direction component.

Worked example

Different equations of the same line

The equation

x23=y4=z5\frac{x-2}{3}=y-4=\frac z5

has base point c=(2,4,0)c=(2,4,0) and direction a=(3,1,5)a=(3,1,5): the middle denominator is implicitly 11. At parameter t=2t=2, the point is (8,6,10)(8,6,10). Thus

x83=y6=z105\frac{x-8}{3}=y-6=\frac{z-10}{5}

describes the same line, with a shifted parameter. Substituting either base point into the other equation confirms membership, while the common direction ensures the entire lines agree. Matching only one point would not be sufficient to identify two lines.

Counterexample mode

A zero direction component is a fixed coordinate

For c=(2,1,5)c=(2,1,5) and a=(3,4,0)a=(3,4,0), the tempting expression (x2)/3=(y1)/4=(z5)/0(x-2)/3=(y-1)/4=(z-5)/0 is undefined. Even at points where z=5z=5, its last ratio is 0/00/0, not a usable parameter.

The correct equation is

x23=y14,z=5,\frac{x-2}{3}=\frac{y-1}{4},\qquad z=5,

or (x,y,z)=(2,1,5)+t(3,4,0)(x,y,z)=(2,1,5)+t(3,4,0). For example, t=1t=1 gives (5,5,5)(5,5,5), which satisfies the repaired equations. Omitting z=5z=5 altogether would allow arbitrary heights and describe a plane, so the fixed coordinate must be retained rather than discarded.

Distance from a point to a line

Theorem

The perpendicular foot gives the nearest point on a line

Let L=c+RaL=c+\mathbb Ra with a0a\ne\mathbf0, and let qRnq\in\mathbb R^n. Put v=qcv=q-c. Then the unique nearest point and the distance are

t=vaa2,q=c+ta,d(q,L)=vta.t_* =\frac{v\cdot a}{\|a\|^2},\qquad q'=c+t_*a,\qquad d(q,L)=\|v-t_*a\|.

Equivalently,

d(q,L)2=v2(va)2a2.d(q,L)^2=\|v\|^2-\frac{(v\cdot a)^2}{\|a\|^2}.

Let r=vtar=v-t_*a. The chosen coefficient makes ra=0r\cdot a=0. For any other parameter tt, the displacement from the line point to qq is r+(tt)ar+(t_*-t)a. Its squared length is

q(c+ta)2=r2+(tt)2a2.\|q-(c+ta)\|^2=\|r\|^2+(t-t_*)^2\|a\|^2.

The mixed term vanishes by orthogonality. The second term is nonnegative and, since a0a\ne\mathbf0, vanishes only at t=tt=t_*. This proves both the minimum and uniqueness of the foot, not just that a perpendicular candidate exists. Expanding r2\|r\|^2 gives the alternate distance formula. Distance zero means qq already lies on the line.

The foot is independent of the chosen base point. Replacing cc by c+t0ac+t_0a changes the displacement to vt0av-t_0a and the minimizing parameter to tt0t_*-t_0. Consequently

(c+t0a)+(tt0)a=c+ta.(c+t_0a)+(t_*-t_0)a=c+t_*a.

Thus different parameter descriptions give the same geometric nearest point. The formula must project qcq-c, not the position vector qq alone. For example, on L=(0,1)+R(1,0)L=(0,1)+\mathbb R(1,0), the foot from q=(2,3)q=(2,3) is (2,1)(2,1). Projecting qq directly onto (1,0)(1,0) would give (2,0)(2,0), which is not on LL. Subtract the base before projecting a displacement, then add it back to obtain a point on the affine line.

Worked example

A shortest distance from a point to a line

Consider

x23=y+12=z22,Q=(10,3,4).\frac{x-2}{3}=\frac{y+1}{-2}=\frac{z-2}{2},\qquad Q=(10,-3,4).

Read the base point from all three numerators: c=(2,1,2)c=(2,-1,2), with a=(3,2,2)a=(3,-2,2). Then v=Qc=(8,2,2)v=Q-c=(8,-2,2), va=24+4+4=32v\cdot a=24+4+4=32, and a2=17\|a\|^2=17. Therefore

proja(v)=3217(3,2,2),r=117(40,30,30).\operatorname{proj}_a(v)=\frac{32}{17}(3,-2,2),\qquad r=\frac1{17}(40,30,-30).

The check ra=(1206060)/17=0r\cdot a=(120-60-60)/17=0 confirms the residual is perpendicular to the line. The foot is q=(130,81,98)/17q'=(130,-81,98)/17, and the distance is

d(Q,L)=402+302+(30)2172=20017.d(Q,L)=\sqrt{\frac{40^2+30^2+(-30)^2}{17^2}} =\sqrt{\frac{200}{17}}.

Every component matters: changing the constant in the third numerator would change the line's position and hence this distance calculation.

Distance between two nonparallel lines

Let L1=c1+Ra1L_1=c_1+\mathbb Ra_1 and L2=c2+Ra2L_2=c_2+\mathbb Ra_2 in R3\mathbb R^3, with nonzero, nonparallel directions. Write

r=(c1c2)+ta1sa2.r=(c_1-c_2)+ta_1-sa_2.

This is the displacement from a point on L2L_2 to a point on L1L_1. Solve ra1=ra2=0r\cdot a_1=r\cdot a_2=0 for t,st,s. The coefficient determinant is nonzero because strict Cauchy–Schwarz gives a12a22(a1a2)2>0\|a_1\|^2\|a_2\|^2-(a_1\cdot a_2)^2\gt0 for nonparallel directions. Thus the candidate pair is uniquely determined.

To prove it minimizes distance, perturb the parameters by h,kh,k. The new connector is r+ha1ka2r+ha_1-ka_2, whose squared norm is

r+ha1ka22=r2+ha1ka22r2.\|r+ha_1-ka_2\|^2=\|r\|^2+\|ha_1-ka_2\|^2\ge\|r\|^2.

Orthogonality removes the mixed term. Nonparallel directions make equality possible only when h=k=0h=k=0. The distance is r\|r\|: zero for intersecting lines, positive for skew lines. For parallel lines the determinant vanishes; instead take any point on one line and find its distance to the other line.

Worked example

The shortest connector between skew lines

Let

L1:(4,1,8)+t(0,1,2),L2:(4,5,11)+s(1,3,4).L_1:(4,1,8)+t(0,1,-2),\qquad L_2:(4,-5,11)+s(1,-3,4).

The connector from L2L_2 to L1L_1 is r=(s,6+t+3s,32t4s)r=(-s,6+t+3s,-3-2t-4s). Perpendicularity to the two directions gives

12+5t+11s=0,3011t26s=0.12+5t+11s=0,\qquad -30-11t-26s=0.

Solving yields t=2t=2, s=2s=-2. The closest points are A=(4,3,4)A=(4,3,4) and B=(2,1,3)B=(2,1,3), so r=AB=(2,2,1)r=A-B=(2,2,1). Direct checks give r(0,1,2)=0r\cdot(0,1,-2)=0 and r(1,3,4)=0r\cdot(1,-3,4)=0. Hence the distance is 4+4+1=3\sqrt{4+4+1}=3. Its positive value also confirms that the nonparallel lines do not intersect.

Planes and normal vectors

Definition

Point-normal and Cartesian equations of a plane

For p0R3p_0\in\mathbb R^3 and nonzero normal ν=(A,B,C)\nu=(A,B,C), the plane is

Π={x:ν(xp0)=0}.\Pi=\{x:\nu\cdot(x-p_0)=0\}.

Expanding gives Ax+By+Cz+D=0Ax+By+Cz+D=0, where D=νp0D=-\nu\cdot p_0 and (A,B,C)(0,0,0)(A,B,C)\ne(0,0,0).

The displacement between any two points of the plane is orthogonal to ν\nu. Multiplying all four Cartesian coefficients by the same nonzero scalar preserves the plane. If the normal were zero, the equation would describe all of R3\mathbb R^3 when D=0D=0, or the empty set when D0D\ne0, rather than a plane. Thus its nonzero condition is geometrical as well as algebraic.

Concept lensGeometric

A line direction lies along an object; a normal points across it

For a line, aa describes allowed displacements: points differ by multiples of aa. For a plane, ν\nu describes a forbidden component: every allowed displacement has zero dot product with ν\nu. A plane's normal is therefore not a direction along the plane.

This explains the two distance constructions. For point-to-line distance, remove the component along the line and measure the residual. For point-to-plane distance, measure the normal component and retain the perpendicular residual as a displacement inside the plane. The same orthogonal decomposition serves two different geometric targets.

Theorem

Nearest point and distance to a plane

Let Π={x:νx+D=0}\Pi=\{x:\nu\cdot x+D=0\} with ν0\nu\ne\mathbf0. For any point qq,

q=qνq+Dν2νΠ,d(q,Π)=νq+Dν.q'=q-\frac{\nu\cdot q+D}{\|\nu\|^2}\nu\in\Pi,\qquad d(q,\Pi)=\frac{|\nu\cdot q+D|}{\|\nu\|}.

Substitution verifies νq+D=0\nu\cdot q'+D=0, and qqq-q' is parallel to the normal. For any xΠx\in\Pi, qxq'-x is orthogonal to ν\nu. Therefore

qx2=qq2+qx2.\|q-x\|^2=\|q-q'\|^2+\|q'-x\|^2.

This is minimized uniquely at x=qx=q'. Taking the norm of the displayed normal component proves the distance formula, including its absolute value. The signed numerator changes sign if the normal orientation is reversed; the distance does not. Rescaling the whole plane equation also leaves the quotient unchanged because its numerator and denominator acquire the same absolute scalar factor.

Worked example

Distance from the origin to a plane

For Π:2x2yz3=0\Pi:2x-2y-z-3=0, take ν=(2,2,1)\nu=(2,-2,-1), so ν=3\|\nu\|=3. The origin has distance 3/3=1|-3|/3=1. Its perpendicular foot is

q=13(2,2,1).q'=\frac13(2,-2,-1).

Substitution gives 4/3+4/3+1/33=04/3+4/3+1/3-3=0, verifying that the foot lies in the plane. Its norm is 11, agreeing with the distance calculation.

Intersecting, measuring, and projecting a line

Theorem

All line-plane intersection cases

Let L=c+RaL=c+\mathbb Ra, a0a\ne\mathbf0, and Π:νx+D=0\Pi:\nu\cdot x+D=0, ν0\nu\ne\mathbf0. Substitution gives

(νa)t+(νc+D)=0.(\nu\cdot a)t+(\nu\cdot c+D)=0.

If νa0\nu\cdot a\ne0, there is exactly one intersection, at t=(νc+D)/(νa)t=-(\nu\cdot c+D)/(\nu\cdot a). If νa=0\nu\cdot a=0 and νc+D=0\nu\cdot c+D=0, the entire line is contained in Π\Pi. If the first quantity is zero but the second is not, there is no intersection.

These are exactly the three cases of one scalar linear equation. Check the coefficient before dividing: the zero case is meaningful information about the geometry, not a numerical failure to suppress.

The unoriented angle α[0,π/2]\alpha\in[0,\pi/2] between the line and plane satisfies

sinα=aνaν.\sin\alpha=\frac{|a\cdot\nu|}{\|a\|\|\nu\|}.

To see this, take the angle β[0,π/2]\beta\in[0,\pi/2] between the line and the plane’s normal direction, defined by cosβ=aν/(aν)\cos\beta=|a\cdot\nu|/(\|a\|\|\nu\|); then α=π/2β\alpha=\pi/2-\beta. Absolute value makes the result independent of the chosen signs of aa and ν\nu. The endpoints give angle zero for a line parallel to the plane's directions, including a contained line, and π/2\pi/2 for a line perpendicular to the plane.

Project each point c+tac+ta using the plane's nearest-point formula. Collecting the constant and parameter terms gives

c=cνc+Dν2ν,a=aνaν2ν,projΠ(c+ta)=c+ta.\begin{aligned} c'&=c-\frac{\nu\cdot c+D}{\|\nu\|^2}\nu,\\ a'&=a-\frac{\nu\cdot a}{\|\nu\|^2}\nu,\\ \operatorname{proj}_{\Pi}(c+ta)&=c'+ta'. \end{aligned}

Here cΠc'\in\Pi and νa=0\nu\cdot a'=0. If a0a'\ne\mathbf0, the image is a line. If a=0a'=\mathbf0, equivalently aa is parallel to ν\nu, the image is the single point cc'. Projecting a line therefore need not produce a line. The point formula includes DD, while the direction formula does not: a direction is a displacement, not a point to be placed on an affine plane.

Worked example

Intersection, angle, and projection in one calculation

Let L:(1,2,0)+t(2,1,2)L:(1,2,0)+t(2,-1,2) and Π:x+y+z=0\Pi:x+y+z=0. Here a=(2,1,2)a=(2,-1,2), ν=(1,1,1)\nu=(1,1,1), and substitution gives 3+3t=03+3t=0. Thus t=1t=-1 and the intersection is (1,3,2)(-1,3,-2).

Since aν=3a\cdot\nu=3, a=3\|a\|=3, and ν=3\|\nu\|=\sqrt3, sinα=1/3\sin\alpha=1/\sqrt3, with α=arcsin(1/3)\alpha=\arcsin(1/\sqrt3). For the projected line,

c=(0,1,1),a=(1,2,1).c'=(0,1,-1),\qquad a'=(1,-2,1).

Consequently its equation is (0,1,1)+t(1,2,1)(0,1,-1)+t(1,-2,1). It passes through the intersection at t=1t=-1, so an equivalent symmetric equation is

x+1=y32=z+2.x+1=\frac{y-3}{-2}=z+2.

Both the base point and direction satisfy the appropriate plane conditions: νc=0\nu\cdot c'=0 and νa=0\nu\cdot a'=0. Merely finding a parallel direction would not locate the projected line.

Affine hyperplanes

In Rn\mathbb R^n, the same point-normal construction gives an affine hyperplane

H={xRn:νx+b=0},ν0.H=\{x\in\mathbb R^n:\nu\cdot x+b=0\},\qquad \nu\ne\mathbf0.

At least one normal component is nonzero, so its coordinate can be solved uniquely in terms of the other n1n-1 free coordinates. This explains why the hyperplane has dimension n1n-1. It is a line in R2\mathbb R^2, a plane in R3\mathbb R^3, and a single point when n=1n=1. The distance and nearest-point proofs use only dot products, so they apply unchanged in every dimension. In particular, a planar line Ax+By+C=0Ax+By+C=0, with (A,B)(0,0)(A,B)\ne(0,0), has normal (A,B)(A,B) and distance formula Ax0+By0+C/A2+B2|Ax_0+By_0+C|/\sqrt{A^2+B^2}.

Quick checks

Checkpoint

Q1. A line direction has a zero third component. What replaces the third ratio in a symmetric equation?

Return to the parameter equation for that coordinate.

Solution · Quick-check Q1

The equation is z=c3z=c_3. The coordinate is fixed, not divided by zero and not omitted.

Checkpoint

Q2. If the line direction is orthogonal to the plane normal, must the line miss the plane?

Distinguish the directional condition from the base-point condition.

Solution · Quick-check Q2

No. If νc+D=0\nu\cdot c+D=0, the whole line lies in the plane. Otherwise the line is disjoint from it. Both cases have νa=0\nu\cdot a=0.

Summary

Parameter equations specify a point and a nonzero direction; normal equations specify an affine constraint. Orthogonal residuals prove the distance formulas and their minimizing properties. Line-plane questions reduce to a scalar intersection equation and the normal component of the direction. Always retain fixed coordinates, check nonzero divisors, and distinguish a projected point from a projected direction.

Exercises

  1. Derive the normal and distance formula for the planar line Ax+By+C=0Ax+By+C=0, assuming (A,B)(0,0)(A,B)\ne(0,0). Apply it to 3x+4y10=03x+4y-10=0 and the origin.
  2. Find the foot from Q=(10,3,4)Q=(10,-3,4) to the line in the second worked example. Verify both line membership and residual orthogonality.
  3. For Π:x+y+z=0\Pi:x+y+z=0, classify the intersections with L1:(1,0,1)+t(1,1,0)L_1:(1,0,-1)+t(1,-1,0) and L2:(1,0,0)+t(1,1,0)L_2:(1,0,0)+t(1,-1,0).
  4. Project the line (1,2,0)+t(1,1,1)(1,2,0)+t(1,1,1) onto x+y+z=0x+y+z=0. Is the image a line or a point? Give its coordinates.

Guided solutions

Solution · Solution 1

Subtract the equations of two points on the line to obtain (A,B)(xx,yy)=0(A,B)\cdot(x-x',y-y')=0. Thus (A,B)(A,B) is a nonzero normal, and the hyperplane distance formula applies. For the given line, distance is 10/9+16=210/\sqrt{9+16}=2, and the foot is (6/5,8/5)(6/5,8/5).

Solution · Solution 2

The foot is (130,81,98)/17=c+(32/17)a(130,-81,98)/17=c+(32/17)a, where c=(2,1,2)c=(2,-1,2) and a=(3,2,2)a=(3,-2,2). All three symmetric ratios equal 32/1732/17. The displacement from the foot to QQ is (40,30,30)/17(40,30,-30)/17, whose dot product with aa is zero.

Solution · Solution 3

Both directions have dot product zero with (1,1,1)(1,1,1). The first base point has coordinate sum zero, so L1L_1 is contained in the plane. The second base point has sum one, so L2L_2 has no intersection with it.

Solution · Solution 4

The direction equals the normal, so its projected direction is zero. Projecting the base point subtracts (1,1,1)(1,1,1), giving (0,1,1)(0,1,-1). Every parameter value has this same image; the projection is one point.