Distance from a point to a line: geometric method
Find a perpendicular foot, justify minimal distance, and distinguish distances to a line and a segment.
Content updated: October 22, 2026
The distance from a point to a line is the length of the perpendicular segment to its foot on the line. Joining the point to an arbitrary point on the line does not automatically yield the required distance.
Learning goals: construct the perpendicular foot, prove the shortest-distance property, and calculate distances using right triangles.
Prerequisites: a line perpendicular to a plane (English lesson); the Pythagorean theorem and orthogonal projection.
On this page: Idea · Method · Examples · Practice · Next lesson
1. Definition and zero distance
Let $M$ be a point and $\Delta$ a line. If $M\notin\Delta$, choose $H\in\Delta$ such that $MH\perp\Delta$. The point $H$ is the orthogonal projection of $M$, and the distance is
If $M\in\Delta$, its projection is $M$ itself and the distance is $0$. Do not call $MH$ a line when $M=H$. Distance is always nonnegative and equals $0$ if and only if the point belongs to the line.
2. Why use the perpendicular segment?
For $M\notin\Delta$ and every $Q\in\Delta$ distinct from $H$, triangle $MHQ$ is right-angled at $H$, so $MQ^2=MH^2+HQ^2>MH^2$. If $Q=H$, then $MQ=MH$. Hence $MH$ is the minimum length of a segment joining $M$ to a point on the line.
- Find a point $H$ on the actual line under consideration.
- Prove $MH\perp\Delta$, usually using a known right angle or the line-plane criterion.
- Calculate $MH$ with the Pythagorean theorem, an altitude identity, or other suitable geometric data.
- Check length units and the case in which the point already belongs to the line.
Distance to a line differs from distance to a segment. The foot $H$ may lie outside the drawn segment but still belong to its containing line. For distance to the segment, check the foot position; if it lies outside, the nearest segment point is an endpoint.
3. Worked examples
Example 1. Two distances in a rectangular box
Let $ABCD.A^{\prime}B^{\prime}C^{\prime}D^{\prime}$ be a rectangular box with corresponding upper and base vertices, where $AB=a>0$, $AD=b>0$, and $AA^{\prime}=c>0$. Calculate the distances from $A$ to $BC$ and to $C^{\prime}D^{\prime}$.
Since $B\in BC$ and $AB\perp BC$, the projection of $A$ onto $BC$ is $B$. Hence $d(A,BC)=AB=a$.
The lines $A^{\prime}D^{\prime},DD^{\prime}$ intersect at $D^{\prime}$ in the plane $(ADD^{\prime}A^{\prime})$. The line $C^{\prime}D^{\prime}$ is perpendicular to both and hence to that plane. Since $AD^{\prime}$ lies in the plane, $AD^{\prime}\perp C^{\prime}D^{\prime}$. The point $D^{\prime}$ belongs to the required line, so it is the perpendicular foot of $A$.
Triangle $ADD^{\prime}$ is right-angled at $D$, with $AD=b$ and $DD^{\prime}=c$. Therefore
Example 2. A perpendicular foot supplied by the hypotheses
Let $S.ABC$ be a pyramid with $SA\perp(ABC)$ and $SA=h>0$. Since $A\in AB$ and $SA\perp AB$, the projection of $S$ onto line $AB$ is $A$. Thus $d(S,AB)=h$. In contrast, the distance from $B$ to line $AB$ itself is $0$.
4. Practice
- In the box of Example 1, take $a=2,b=3,c=4$. Calculate the two distances above.
- If $M\in\Delta$, what is the distance? Can a line $MM$ be constructed to apply perpendicularity?
- Suppose the perpendicular foot $H$ of $P$ on line $AB$ lies outside segment $AB$. Can we conclude that the distance from $P$ to segment $AB$ is $PH$?
Show answers and hints
- $d(A,BC)=2$, whereas $d(A,C^{\prime}D^{\prime})=\sqrt{3^2+4^2}=5$.
- The distance is $0$, and the projection is $M$. There is no line $MM$.
- No. $PH$ is the distance to the line. The distance to the segment is $\min(PA,PB)$; the nearest point is the endpoint on the same side as the perpendicular foot.
5. Common mistakes
- Choosing a point $H$ outside the line whose distance is required.
- Calculating a segment length without first proving perpendicularity to the line.
- Confusing a line with the drawn edge segment.
- Using a negative length or calling a degenerate segment a perpendicular line.
Leave a Reply