🌱 Tony's Memex Tony's Intertwingled Memex
Digital Garden | OER Curriculum
Home / Digital Garden / Distance Between a Point and a Line in Space

Distance Between a Point and a Line in Space

Core Definition

In three-dimensional space (R3\mathbb{R}^3), the shortest (perpendicular) distance dd from an external point M(xM,yM,zM)M(x_M, y_M, z_M) to a line passing through point P(x0,y0,z0)P(x_0, y_0, z_0) with direction vector v⃗=⟨a,b,c⟩\vec{v} = \langle a, b, c \rangle is given by the cross product formula:

d=∥PM⃗×v⃗∥∥v⃗∥d = \frac{\|\vec{PM} \times \vec{v}\|}{\|\vec{v}\|}
where PM⃗=⟨xM−x0,yM−y0,zM−z0⟩\vec{PM} = \langle x_M - x_0, y_M - y_0, z_M - z_0 \rangle is the displacement vector from the line reference point PP to the external point MM.

Concept Explanation

Geometric Derivation via Parallelogram Area

In 3D space, we cannot use simple 2D slope-perpendicular equations. Instead, we leverage the geometric property of the Cross Product:

                 M (External Point)
                /|
               / |
        PM    /  |  d (Perpendicular Distance = Height)
             /   |
            /    |
           P-----+------------> v (Base)
             (Line Reference)
  1. Parallelogram Spanned by Vectors: The displacement vector PM⃗\vec{PM} and the line's direction vector v⃗\vec{v} define a parallelogram in 3D space.
  2. Cross Product Area: The magnitude of the cross product equals the area of this parallelogram:
    Area=∥PM⃗×v⃗∥\text{Area} = \|\vec{PM} \times \vec{v}\|
  3. Geometric Area Formula: The area of any parallelogram is also given by Base×Height\text{Base} \times \text{Height}:
    Area=∥v⃗∥⋅d\text{Area} = \|\vec{v}\| \cdot d
  4. Equating and Solving for dd:
    ∥v⃗∥⋅d=∥PM⃗×v⃗∥  ⟹  d=∥PM⃗×v⃗∥∥v⃗∥\|\vec{v}\| \cdot d = \|\vec{PM} \times \vec{v}\| \implies d = \frac{\|\vec{PM} \times \vec{v}\|}{\|\vec{v}\|}

Step-by-Step Calculation Recipe

  1. Extract Line Data: Identify a point on the line P(x0,y0,z0)P(x_0, y_0, z_0) and the direction vector v⃗=⟨a,b,c⟩\vec{v} = \langle a, b, c \rangle from the given vector, parametric, or symmetric equations.
  2. Construct Displacement Vector PM⃗\vec{PM}:
    PM⃗=⟨xM−x0,yM−y0,zM−z0⟩\vec{PM} = \langle x_M - x_0, y_M - y_0, z_M - z_0 \rangle
  3. Compute Cross Product Matrix Determinant:
    PM⃗×v⃗=∣i^j^k^xM−x0yM−y0zM−z0abc∣\vec{PM} \times \vec{v} = \begin{vmatrix} \hat{i} & \hat{j} & \hat{k} \\ x_M - x_0 & y_M - y_0 & z_M - z_0 \\ a & b & c \end{vmatrix}
  4. Calculate Magnitudes & Evaluate Distance:
    d=(PM⃗×v⃗)x2+(PM⃗×v⃗)y2+(PM⃗×v⃗)z2a2+b2+c2d = \frac{\sqrt{(\vec{PM}\times\vec{v})_x^2 + (\vec{PM}\times\vec{v})_y^2 + (\vec{PM}\times\vec{v})_z^2}}{\sqrt{a^2 + b^2 + c^2}}

Engineering Applications

  • Robotic Arm Motion Planning: Computing real-time spatial clearance between moving manipulator links (modeled as line segments) and static factory fixtures or worker exclusion zones.
  • Structural Clearance & Utility Routing: Verifying that high-tension building stabilization cables maintain required air gap separations from high-voltage electrical conduits to prevent electrical arcing.
  • Air Traffic Separation Envelopes: Determining minimum approach distances between linear aircraft flight paths and fixed terrain or radio towers.

Example Problems

Example 1: Point to Line in Symmetric Form

Find the shortest distance from the point M(1,1,3)M(1, 1, 3) to the line x−34=y+12=z−3\frac{x-3}{4} = \frac{y+1}{2} = z-3.

Solution
  1. Extract Point and Direction Vector:
    • Point on line: P(3,−1,3)P(3, -1, 3)
    • Direction vector: v⃗=⟨4,2,1⟩\vec{v} = \langle 4, 2, 1 \rangle
  2. Construct PM⃗\vec{PM}:
    PM⃗=⟨1−3,1−(−1),3−3⟩=⟨−2,2,0⟩\vec{PM} = \langle 1 - 3, 1 - (-1), 3 - 3 \rangle = \langle -2, 2, 0 \rangle
  3. Cross Product:
    PM⃗×v⃗=∣i^j^k^−220421∣=i^(2)−j^(−2)+k^(−4−8)=⟨2,2,−12⟩\vec{PM} \times \vec{v} = \begin{vmatrix} \hat{i} & \hat{j} & \hat{k} \\ -2 & 2 & 0 \\ 4 & 2 & 1 \end{vmatrix} = \hat{i}(2) - \hat{j}(-2) + \hat{k}(-4 - 8) = \langle 2, 2, -12 \rangle
  4. Calculate Magnitudes:
    ∥PM⃗×v⃗∥=22+22+(−12)2=152=238\|\vec{PM} \times \vec{v}\| = \sqrt{2^2 + 2^2 + (-12)^2} = \sqrt{152} = 2\sqrt{38}
    ∥v⃗∥=42+22+12=21\|\vec{v}\| = \sqrt{4^2 + 2^2 + 1^2} = \sqrt{21}
  5. Evaluate Distance:
    d=23821=279821≈2.69d = \frac{2\sqrt{38}}{\sqrt{21}} = \frac{2\sqrt{798}}{21} \approx 2.69

Connections & References