Line, point and a nonzero direction
p is the position vector of any point on the line; q belongs to the given point Q.[1]
Form the connecting vector , end minus start. The direction vector need not have unit magnitude, but it must be nonzero. A point on the line gives a valid zero distance. The formula describes a line, not a segment bounded by two endpoints or a ray extending only forward.[1]
For a second line, first determine the relation between two lines in space; point-to-line distance alone does not distinguish the cases.
Use one length unit for all position coordinates and perpendicular axes. If u also carries a length unit, the cross-product magnitude is an area; dividing by leaves a length. If u is a dimensionless direction, parameter t instead carries a length unit. Either parameterization is valid when units remain consistent.[1]
Area argument and perpendicular-foot method
Vectors w and u span a parallelogram. Its base has magnitude , and its height is exactly the perpendicular from Q to the line through P. The cross-product magnitude is therefore also base times the required distance. Dividing by the base establishes the formula.[1][2]
The perpendicularity condition solves to the stated parameter. The residual is perpendicular to u, and its norm agrees with the cross-product formula. Replacing u by , with , multiplies both numerator and denominator by |λ|, leaving distance unchanged.[1][3]
Work through a foot and a direction change
A perpendicular foot beyond the first parameter interval
- Given
- , , ; positions in metres and u in the same length unit.
- Find
- Calculate distance and foot for the infinite line.
Setup: divide area by direction magnitude and also find the projection parameter.
Substitute the connecting vector and cross product.
Parameter 2 gives point H on the line.
Result: The distance is√5 m, approximately 2.236 m; the perpendicular foot is H=(5,1,0).
Check: , hence in square metres. Its norm is also√5 m. A line parameter is allowed to exceed 1.
A negative direction represents the same line
- Given
- , , , coordinates in metres.
- Find
- Find the distance and check it using u′=−7 u.
Setup: any nonzero direction scale must cancel in the ratio.
Substitute the two direction representations separately.
With u′=(0,0,21), the area magnitude becomes 105.
Result: Both direction vectors give a distance of 5 m.
Check: The foot is . has magnitude 5 m and zero z-component, so it is perpendicular to either vertical direction. With u, the foot parameter is−2.
Recall the method later with the formula’s flashcards.
10 flashcards · English materials
Already have an account? Sign in for flashcardsAvailable from Essential. A ready-made formula set, no AI credits required. Article exercises are not all included.
Check lines, segments and zero cases
Calculate · Foundation
Find the distance from Q=(2,−3,4) to the line through the origin with direction(1,0,0).
Show hint
The foot can have the same x-coordinate.
Learning goal: Recognize distance to a coordinate axis.
Show solution and calculation
The foot is H=(2,0,0).
.
Alternatively, the cross product with(1,0,0)is(0,4,3), again of magnitude 5.
Interpret · Application
Does Q=(5,−5,5) lie on g with P=(2,1,−1) and u=(1,−2,2)? Find the distance.
Show hint
Compare Q−P with u.
Learning goal: Distinguish a valid zero distance from a zero denominator.
Show solution and calculation
, so Q lies on g at t=3.
The cross product is zero and the denominator is positive; zero is a valid distance.
Error analysis · Application
Someone inserts u=(0,0,0) and interprets 0/0 as zero distance. Explain the error.
Show hint
Which point set is described by p+t·0?
Learning goal: Recognize a direction that does not define a line.
Show solution and calculation
describes a single point, not a line.
The formula requires u≠0;0/0 is undefined.
Distance to the single point P is instead , which is not always zero.
Rearrange · Application
In the first example, replace u by u′=−2 u. Which parameter gives the same foot?
Show hint
The vector t′u′ must equal t*u.
Learning goal: Adjust the parameter when rescaling direction.
Show solution and calculation
The original parameter is .
From , obtain .
Thus .
Both foot and distance remain unchanged.
Transfer · Challenge
Restrict the first line to the segment from P=(1,−1,0) to B=P+u=(3,0,0). What is the distance from Q=(4,3,0) now?
Show hint
Only parameters between 0 and 1 are allowed on the segment.
Learning goal: Compare segment distance with infinite-line distance.
Show solution and calculation
The unrestricted foot parameter is 2, outside the segment.
The closest segment point is therefore endpoint B at t=1.
, so .
The smaller value√5 belongs to the infinite line.
In general, clamp the free parameter to[0,1].
Check your understanding with the formula’s reference test.
8 test questions · English materials
Already have an account? Sign in for the testAvailable from Essential. A ready-made formula set, no AI credits required. Article exercises are not all included.
Area, projection and plane distance
The cross product gives the parallelogram area. The dot product alternatively determines the foot parameter and checks perpendicularity. The Hesse normal form computes distance to a plane through normal projection; its perpendicular direction is already given by the plane coefficients.[1][2][3]
Sources for this explanation
Quanta · Updated November 5, 2026
- OpenStax Calculus Volume3 §2.5: point-line and point-plane distance in space
- OpenStax Calculus Volume3 §2.4: cross product, orientation and area
- OpenStax Calculus Volume3 §2.3: dot product, angle and orthogonal projection
Editorial responsibility: Quanta Study editorial team
Review scope
This explanation, 2 worked examples and 5 exercises are available in German and English. Structure, source references and mathematical notation undergo automated checks. Calculations, model assumptions and both language versions receive a separate AI review.
An independent, named human subject review has not yet been documented. Our exercise numbers are worked examples, rather than measurements published by the cited sources.
Editorial responsibility, sources and methodsChange history
- Added contextual links to relevant next learning steps.
- Authored a full German-English article with an original explanation, two worked examples and five varied exercises.
Cite this reference page
Quanta. Distance Point-Line. Updated November 5, 2026. https://quanta-study.de/en/formula-sheet/abstand-punkt-gerade
When citing a specific scientific statement, also cite the specialist source linked to that statement.