Pv16, Pv17 - Point-to-line and point-to-plane distances

Pv16, Pv17 - Point-to-line and point-to-plane distances

Distance to a line or plane means the shortest distance, measured along a perpendicular connector. Pv16 covers a point and a line in two or three dimensions; Pv17 covers a point and a plane. You will use the supplied formulae where they apply and find a perpendicular foot when a three-dimensional line needs a geometric method.

Distance to a line in two dimensions

The point (4,1)(4,1) is 17\sqrt{17} units from the origin. Is that its distance from the line 3x+4y−6=03x+4y-6=0?

No: the origin is not even on that line. Even a point that is on the line need not be the nearest point. The shortest connector meets the line at right angles; any sideways movement along the line adds an extra component to the journey.

Shortest distance and perpendicular foot

The distance from a point to a line or plane is the length of the shortest segment joining them. Its endpoint on the target is the perpendicular foot. A point already on the target has distance zero.

For a two-dimensional line written with zero on the right, the booklet supplies a direct formula. Keep its constant term and its sign.

Point-to-line distance in two dimensions

For P(x1,y1)P(x_1,y_1) and the line ax+by+c=0ax+by+c=0, where aa and bb are not both zero,

d=∣ax1+by1+c∣a2+b2d=\frac{|ax_1+by_1+c|}{\sqrt{a^2+b^2}}

In the formula booklet.

The absolute value makes the distance non-negative. A negative numerator before the absolute value tells you which side the chosen normal points towards; it does not mean a negative length.

Worked example 1: retaining the line's constant

Question. Find the shortest distance from (4,1)(4,1) to 3x+4y−6=03x+4y-6=0.

Plan. Substitute the point into the supplied formula, including the constant −6-6.

ax1+by1+c=3(4)+4(1)−6=10signed numeratora2+b2=32+42=5normal lengthd=∣10∣5=2shortest distance\begin{aligned} ax_1+by_1+c&=3(4)+4(1)-6=10 && \text{signed numerator} \\ \sqrt{a^2+b^2}&=\sqrt{3^2+4^2}=5 && \text{normal length} \\ d&=\frac{|10|}{5}=2 && \text{shortest distance} \end{aligned}

Why this step? The constant locates the line. Omitting it would calculate distance to the different line 3x+4y=03x+4y=0.

Answer. 22 units.

Check. The point (14/5,−3/5)(14/5,-3/5) lies on the line, and its displacement to (4,1)(4,1) is (6/5,8/5)(6/5,8/5), parallel to the normal (3,4)(3,4), with length 22.

The next example changes only the sign of the complete line equation. The line is identical, so the distance must remain identical.

Worked example 2: the normal points the other way

Question. Find the shortest distance from (4,1)(4,1) to −3x−4y+6=0-3x-4y+6=0.

Plan. Use the signed coefficients as given, then take the absolute numerator.

ax1+by1+c=−3(4)−4(1)+6=−10opposite signed numeratora2+b2=(−3)2+(−4)2=5same normal lengthd=∣−10∣5=2positive length\begin{aligned} ax_1+by_1+c&=-3(4)-4(1)+6=-10 && \text{opposite signed numerator} \\ \sqrt{a^2+b^2}&=\sqrt{(-3)^2+(-4)^2}=5 && \text{same normal length} \\ d&=\frac{|-10|}{5}=2 && \text{positive length} \end{aligned}

Why this step? Reversing a normal changes the numerator's sign but cannot move the line. The absolute value makes the formula independent of that choice.

Answer. 22 units.

Check. Multiplying the equation by −1-1 gives the line in Worked example 1.

In fact, multiplying the entire line equation by any non-zero scalar leaves the distance unchanged: both the absolute numerator and the denominator are multiplied by that scalar's absolute value. An equation can change dramatically on the page while describing exactly the same geometry.

Watch out

Wrong: for 3x+4y=63x+4y=6, use c=6c=6 in the zero-right-side formula. Right: rearrange to 3x+4y−6=03x+4y-6=0, so c=−6c=-6.

The opening distance is 22, measured to the line rather than to the origin. Apply the same formula to new coefficients here.

Finding the nearest point on a three-dimensional line

In three dimensions, put the unknown foot on the line and require the connector from that foot to the given point to be perpendicular to the line's direction.

You already know

For a line r=a+td\mathbf{r}=\mathbf{a}+t\mathbf{d}, a possible foot HH has position h=a+td\mathbf{h}=\mathbf{a}+t\mathbf{d}. Perpendicular non-zero vectors have scalar product zero, so the foot satisfies (p−h).d=0(\mathbf{p}-\mathbf{h}).\mathbf{d}=0.

The right triangle explains the minimisation: moving away from HH along the line adds a non-zero sideways leg, so the new connector is longer. The scalar-product condition locates the foot; it also works when the given point lies on the line, giving a zero distance.

[DIAGRAM: asset_name: The shortest connector meets the line at right angles; asset_slug: b028_perpendicular_foot; caption: The perpendicular connector is shorter than any connector with extra movement along the line; description: A view in the plane containing a point and a line shows blue line AH, clay point P above it, and sage segment HP at right angles to the line. An oblique grey segment AP is longer. Labels use A=(1,0,0), H=(2,2,2), P=(4,1,2); AH has length 3 and HP has length root 5. A right-angle marker sits at H. The view is a cross-section of the three-dimensional geometry, not an x-y coordinate plot.]
The perpendicular connector is shorter than any connector with extra movement along the line

This perpendicular-foot method is not a separate formula in the booklet. It uses the line equation and scalar product you already know; no three-dimensional distance formula has to be memorised to use it.

Worked example 3: locating the perpendicular foot

Question. Find the shortest distance from P(4,1,2)P(4,1,2) to r=(100)+t(122)\mathbf{r}=\begin{pmatrix}1\\0\\0\end{pmatrix}+t\begin{pmatrix}1\\2\\2\end{pmatrix}.

Plan. Write the coordinates of a point HH on the line, solve HP→.d=0\overrightarrow{HP}.\mathbf{d}=0, then find ∣HP→∣|\overrightarrow{HP}|.

H=(1+t,2t,2t)foot lies on the lineHP→=(3−t,1−2t,2−2t)point minus foot(3−t)+2(1−2t)+2(2−2t)=0perpendicular connector9−9t=0  ⟹  t=1solveH=(2,2,2),HP→=(2,−1,0)substituted=22+(−1)2=5connector length\begin{aligned} H&=(1+t,2t,2t) && \text{foot lies on the line} \\ \overrightarrow{HP}&=(3-t,1-2t,2-2t) && \text{point minus foot} \\ (3-t)+2(1-2t)+2(2-2t)&=0 && \text{perpendicular connector} \\ 9-9t&=0\implies t=1 && \text{solve} \\ H&=(2,2,2),\quad\overrightarrow{HP}=(2,-1,0) && \text{substitute} \\ d&=\sqrt{2^2+(-1)^2}=\sqrt5 && \text{connector length} \end{aligned}

Why this step? An arbitrary point on the line gives some connector. The zero scalar product selects the perpendicular one, so its length is the shortest distance.

Answer. 5\sqrt5 units.

Check. (2,−1,0).(1,2,2)=2−2=0(2,-1,0).(1,2,2)=2-2=0, and HH belongs to the line at t=1t=1.

The next example moves the given point by one copy of the line direction, from (4,1,2)(4,1,2) to (5,3,4)(5,3,4). Its nearest foot moves by the same amount, leaving the perpendicular gap unchanged.

Worked example 4: moving alongside the line

Question. Find the shortest distance from Q(5,3,4)Q(5,3,4) to the line in Worked example 3.

Plan. Apply the perpendicular condition with the new point and compare the resulting connector.

H=(1+t,2t,2t)point on the lineHQ→=(4−t,3−2t,4−2t)new connector(4−t)+2(3−2t)+2(4−2t)=0perpendicular condition18−9t=0  ⟹  t=2solveH=(3,4,4),HQ→=(2,−1,0)new foot, same gapd=5connector length\begin{aligned} H&=(1+t,2t,2t) && \text{point on the line} \\ \overrightarrow{HQ}&=(4-t,3-2t,4-2t) && \text{new connector} \\ (4-t)+2(3-2t)+2(4-2t)&=0 && \text{perpendicular condition} \\ 18-9t&=0\implies t=2 && \text{solve} \\ H&=(3,4,4),\quad\overrightarrow{HQ}=(2,-1,0) && \text{new foot, same gap} \\ d&=\sqrt5 && \text{connector length} \end{aligned}

Why this step? Movement parallel to the line changes the along-line component, not the perpendicular component. The calculation shows that the foot's parameter increases by 11.

Answer. 5\sqrt5 units.

Check. (5,3,4)−(4,1,2)=(1,2,2)(5,3,4)-(4,1,2)=(1,2,2), exactly the displacement between the two feet.

Keep a connector and a direction separate: the condition uses their scalar product, while the final distance uses the connector's magnitude.

Watch out

Wrong: set HP→=0\overrightarrow{HP}=\mathbf{0} to find the nearest point. That demands that PP lies on the line. Right: set HP→.d=0\overrightarrow{HP}.\mathbf{d}=0; the shortest connector usually has a non-zero length.

Use the perpendicular condition again in this matched problem.

Using a vector product for a point and a line

When only the distance is needed, the vector product gives the perpendicular gap without finding the foot's coordinates.

Let AA be any point on the line, PP the given point, and d\mathbf{d} a non-zero line direction. The vectors AP→\overrightarrow{AP} and d\mathbf{d} form a parallelogram whose height above the line is the required distance. You already know that its area is the magnitude of their vector product. Dividing that area by its base length leaves the height.

Point-to-line distance in three dimensions

For a line through AA in non-zero direction d\mathbf{d}, and point PP,

d=∣AP→×d∣∣d∣d=\frac{|\overrightarrow{AP}\times\mathbf{d}|}{|\mathbf{d}|}

The order of the vector product changes its direction but not its magnitude. The result is zero when PP lies on the line.

Not in the formula booklet: learn it.

This is an alternative to finding a perpendicular foot. The booklet supplies the vector-product formula; the point-to-line ratio itself is not printed there. Choose the foot method when the nearest point is also requested.

Worked example 5: distance without the foot

Question. Find the shortest distance from P(2,0,4)P(2,0,4) to r=t(111)\mathbf{r}=t\begin{pmatrix}1\\1\\1\end{pmatrix}.

Plan. Use the origin as AA, calculate AP→×d\overrightarrow{AP}\times\mathbf{d}, and divide its magnitude by ∣d∣|\mathbf{d}|.

AP→=(2,0,4),d=(1,1,1)connector and directionAP→×d=(−422)vector product∣AP→×d∣=16+4+4=26aread=263=22area divided by base\begin{aligned} \overrightarrow{AP}&=(2,0,4),\quad\mathbf{d}=(1,1,1) && \text{connector and direction} \\ \overrightarrow{AP}\times\mathbf{d}&=\begin{pmatrix}-4\\2\\2\end{pmatrix} && \text{vector product} \\ |\overrightarrow{AP}\times\mathbf{d}|&=\sqrt{16+4+4}=2\sqrt6 && \text{area} \\ d&=\frac{2\sqrt6}{\sqrt3}=2\sqrt2 && \text{area divided by base} \end{aligned}

Why this step? The vector product removes the along-line component geometrically. Dividing by the direction's length prevents the arbitrary size of that direction vector from changing the distance.

Answer. 222\sqrt2 units.

Check. The foot is (2,2,2)(2,2,2): the connector (0,−2,2)(0,-2,2) is perpendicular to (1,1,1)(1,1,1) and has length 8=22\sqrt8=2\sqrt2.

The next example changes only the size of the direction vector, doubling it. It describes the same line, so the numerator and denominator must scale together.

Worked example 6: the direction need not be a unit vector

Question. Find the shortest distance from (2,0,4)(2,0,4) to r=s(222)\mathbf{r}=s\begin{pmatrix}2\\2\\2\end{pmatrix}.

Plan. Retain the doubled direction in both parts of the ratio.

(2,0,4)×(2,2,2)=(−8,4,4)doubled vector product∣(−8,4,4)∣=64+16+16=46numerator length∣(2,2,2)∣=23denominator lengthd=4623=22scale cancels\begin{aligned} (2,0,4)\times(2,2,2)&=(-8,4,4) && \text{doubled vector product} \\ |(-8,4,4)|&=\sqrt{64+16+16}=4\sqrt6 && \text{numerator length} \\ |(2,2,2)|&=2\sqrt3 && \text{denominator length} \\ d&=\frac{4\sqrt6}{2\sqrt3}=2\sqrt2 && \text{scale cancels} \end{aligned}

Why this step? A direction vector fixes orientation, not a physical unit of length. Any non-zero scalar multiple must give the same geometric distance.

Answer. 222\sqrt2 units.

Check. The parameter relation t=2st=2s identifies this as the previous line, with foot now at s=1s=1.

State the vector product you use. A list of unexplained calculator components does not show which connector and direction went into the method.

Watch out

Wrong: the distance is ∣AP→×d∣|\overrightarrow{AP}\times\mathbf{d}|. That is an area. Right: divide by ∣d∣|\mathbf{d}|, unless a unit direction was deliberately chosen.

The direction in the following problem has a zero component; the component formula for a vector product handles it normally.

Distance perpendicular to a plane

For a point and a plane, the shortest connector follows a normal to the surface, rather than any convenient line through the point.

The supplied formula is the three-coordinate counterpart of the two-dimensional line formula. Again, rearrange the plane so that its right side is zero before reading the constant term.

Point-to-plane distance

For P(x1,y1,z1)P(x_1,y_1,z_1) and the plane n1x+n2y+n3z+c=0n_1x+n_2y+n_3z+c=0, with non-zero normal,

d=∣n1x1+n2y1+n3z1+c∣n12+n22+n32d=\frac{|n_1x_1+n_2y_1+n_3z_1+c|}{\sqrt{n_1^2+n_2^2+n_3^2}}

In the formula booklet.

The denominator is the normal's magnitude. If the point satisfies the plane equation, the numerator is zero, exactly as the geometry requires. You are expected to understand this perpendicular distance, rather than prove the supplied formula.

Worked example 7: a supplied plane-distance formula

Question. Calculate the shortest distance from P(3,2,6)P(3,2,6) to x+2y+2z=1x+2y+2z=1.

Plan. Use the zero-right-side form x+2y+2z−1=0x+2y+2z-1=0 and substitute the point.

n1x1+n2y1+n3z1+c=3+2(2)+2(6)−1=18include the constant∣n∣=1+4+4=3normal magnituded=∣18∣3=6perpendicular distance\begin{aligned} n_1x_1+n_2y_1+n_3z_1+c&=3+2(2)+2(6)-1=18 && \text{include the constant} \\ |\mathbf{n}|&=\sqrt{1+4+4}=3 && \text{normal magnitude} \\ d&=\frac{|18|}{3}=6 && \text{perpendicular distance} \end{aligned}

Why this step? The plane's offset contributes −1-1. The numerator measures departure from this particular plane, not from the parallel plane through the origin.

Answer. 66 units.

Check. H(1,−2,2)H(1,-2,2) lies on the plane, and HP→=(2,4,4)=2(1,2,2)\overrightarrow{HP}=(2,4,4)=2(1,2,2) is normal to it with length 66.

The next example reverses only the plane equation. The normal and signed numerator reverse, while the surface and distance stay fixed.

Worked example 8: a negative signed numerator

Question. Calculate the shortest distance from (3,2,6)(3,2,6) to −x−2y−2z=−1-x-2y-2z=-1.

Plan. Write −x−2y−2z+1=0-x-2y-2z+1=0, then keep the absolute value around the full numerator.

−3−2(2)−2(6)+1=−18signed numerator(−1)2+(−2)2+(−2)2=3normal magnituded=∣−18∣3=6positive distance\begin{aligned} -3-2(2)-2(6)+1&=-18 && \text{signed numerator} \\ \sqrt{(-1)^2+(-2)^2+(-2)^2}&=3 && \text{normal magnitude} \\ d&=\frac{|-18|}{3}=6 && \text{positive distance} \end{aligned}

Why this step? Absolute value applies after adding every signed term. Taking separate absolute values inside the sum would destroy the plane equation.

Answer. 66 units.

Check. Multiplying the plane equation by −1-1 recovers Worked example 7, so the geometry is unchanged.

The opening point-to-line distance and this point-to-plane distance share one principle: use a perpendicular connector. An oblique connector reaches the target, but its extra sideways component makes it longer.

Watch out

Wrong: divide the numerator by n12+n22+n32n_1^2+n_2^2+n_3^2. Right: divide by its square root, the normal's length. For normal (1,2,2)(1,2,2), the denominator is 33, not 99.

This final plane has a negative middle coefficient. Keep it in brackets when finding the normal's magnitude.

Quick Recap

  • Shortest distances use perpendicular connectors; a point already on the target has distance zero.
  • For a two-dimensional line, use the supplied formula after writing the equation with zero on the right.
  • For a three-dimensional line, find a perpendicular foot or divide a connector's vector-product magnitude by the direction length.
  • For a plane, use the supplied formula with the complete signed constant and the normal's magnitude.

The opening point (4,1)(4,1) is 22 units from the line 3x+4y−6=03x+4y-6=0; distance to the origin answers a different question.