Point-Line Distance in 3 Dimensions — Definition, Formula & Examples
Point-line distance in 3 dimensions is the shortest (perpendicular) distance from a point to a line in three-dimensional space. It is computed using the cross product of two vectors derived from the line's direction and the point's position.
Given a line passing through a point with direction vector , and an external point , the distance from to the line is defined as , where denotes the vector cross product and denotes the Euclidean norm.
Key Formula
Where:
- = Shortest (perpendicular) distance from the point to the line
- = A known point on the line
- = The external point whose distance to the line you want
- = Vector from P₀ to P₁, computed as P₁ − P₀
- = Direction vector of the line
- = Cross product
- = Euclidean (L²) norm of a vector
How It Works
To find the distance from a point to a line in 3D, you need two things: a direction vector for the line and a vector from any known point on the line to the external point. The cross product produces a vector whose magnitude equals the area of the parallelogram spanned by those two vectors. Dividing that area by the base length gives the height of the parallelogram, which is exactly the perpendicular distance. This approach works regardless of how the line is parameterized — symmetric form, parametric form, or two-point form all yield the same direction vector.
Worked Example
Problem: Find the distance from the point P₁ = (1, −2, 3) to the line passing through P₀ = (2, 1, −1) with direction vector d = ⟨1, 2, 2⟩.
Step 1: Compute the vector from P₀ to P₁: Subtract the coordinates of P₀ from P₁.
Step 2: Compute the cross product: Use the determinant formula for the cross product of the two vectors.
Step 3: Find the magnitude of the cross product: Compute the Euclidean norm of the resulting vector.
Step 4: Divide by the magnitude of d: This gives the perpendicular distance.
Answer: The distance is units.
Another Example
Problem: Find the distance from the origin (0, 0, 0) to the line through (3, 0, 0) with direction vector d = ⟨0, 1, 0⟩.
Step 1: Vector from P₀ to P₁: P₀ = (3, 0, 0) and P₁ = (0, 0, 0).
Step 2: Cross product: Compute the cross product with d = ⟨0, 1, 0⟩.
Step 3: Compute the distance: The magnitude of the cross product is 3, and the magnitude of d is 1.
Answer: The distance is 3 units, which makes geometric sense: the line runs along the y-axis shifted 3 units in the x-direction.
Why It Matters
This formula appears routinely in multivariable calculus and linear algebra courses, particularly when studying lines and planes in . In computer graphics and robotics, it is used to test clearances, detect collisions, and compute ray-object distances. Physics applications include finding the closest approach between a charged particle's trajectory and a wire carrying current.
Common Mistakes
Mistake: Using the dot product instead of the cross product
Correction: The dot product gives a scalar projection along the line, not the perpendicular distance. You need the cross product, which captures the component orthogonal to the direction vector.
Mistake: Forgetting to divide by the magnitude of the direction vector
Correction: The cross product magnitude alone gives the area of a parallelogram. You must divide by ‖d‖ to convert that area into the perpendicular height (the distance). If d happens to be a unit vector, this step has no visible effect, which is why some students miss it.
