How to Find the Distance from a Point to a Line in 3D?

Finding the distance from a point to a line in 3D space can be a bit tricky, but with the right approach, it becomes manageable. We use vector projection and the cross product to solve this problem.

Step-by-Step Solution

Given Information

Suppose you have a point $P(x_1, y_1, z_1)$ and a line defined by a point $A(x_2, y_2, z_2)$ and a direction vector $mathbf{d} = langle a, b, c rangle$

1. Vector from Point to Line

First, find the vector from point $A$ on the line to point $P$:

$mathbf{AP} = langle x_1 – x_2, y_1 – y_2, z_1 – z_2 rangle$

2. Cross Product

Next, compute the cross product of $mathbf{AP}$ and the direction vector $mathbf{d}$:

$mathbf{AP} times mathbf{d} = left| begin{matrix} mathbf{i} & mathbf{j} & mathbf{k} \ x_1 – x_2 & y_1 – y_2 & z_1 – z_2 \ a & b & c end{matrix} right|$

This results in a new vector $mathbf{N}$:

$mathbf{N} = langle (y_1 – y_2)c – (z_1 – z_2)b, (z_1 – z_2)a – (x_1 – x_2)c, (x_1 – x_2)b – (y_1 – y_2)a rangle$

3. Magnitude of the Cross Product

Find the magnitude of vector $mathbf{N}$:

$|mathbf{N}| = sqrt{[(y_1 – y_2)c – (z_1 – z_2)b]^2 + [(z_1 – z_2)a – (x_1 – x_2)c]^2 + [(x_1 – x_2)b – (y_1 – y_2)a]^2}$

4. Magnitude of the Direction Vector

Find the magnitude of the direction vector $mathbf{d}$:

$|mathbf{d}| = sqrt{a^2 + b^2 + c^2}$

5. Distance Formula

Finally, the distance $D$ from the point $P$ to the line is given by:

$D = frac{|mathbf{N}|}{|mathbf{d}|}$

Example Calculation

Let’s say point $P$ is $(1, 2, 3)$ and the line passes through point $A(4, 5, 6)$ with direction vector $mathbf{d} = langle 1, 0, 1 rangle$

  1. Calculate $mathbf{AP}$:

$mathbf{AP} = langle 1 – 4, 2 – 5, 3 – 6 rangle = langle -3, -3, -3 rangle$

  1. Compute $mathbf{AP} times mathbf{d}$:

$mathbf{AP} times mathbf{d} = left| begin{matrix} mathbf{i} & mathbf{j} & mathbf{k} \ -3 & -3 & -3 \ 1 & 0 & 1 end{matrix} right| = langle -3, 0, 3 rangle$

  1. Find $|mathbf{N}|$:

$|mathbf{N}| = sqrt{(-3)^2 + 0^2 + 3^2} = sqrt{18} = 3sqrt{2}$

  1. Find $|mathbf{d}|$:

$|mathbf{d}| = sqrt{1^2 + 0^2 + 1^2} = sqrt{2}$

  1. Calculate the distance $D$:

$D = frac{3sqrt{2}}{sqrt{2}} = 3$

So, the distance from point $P(1, 2, 3)$ to the line is 3 units.

Conclusion

By following these steps, you can determine the distance from any point to a line in 3D space. Understanding this process can be very useful in fields like physics, engineering, and computer graphics.

3. Brilliant – Distance from Point to Line

Citations

  1. 1. Khan Academy – Distance between point and line
  2. 2. Wolfram MathWorld – Point-Line Distance

Related

(2) O3 + H → O2 + OH k2 = 1.78×10^-11 cm^3 s^-1 (3) O + OH → O2 + H k3 = 4.40×10^-11 cm^3 s^-1 (5) O + HO2 → O2 + OH k5 = 3.50×10^-11 cm^3 s^-1 (6) H + HO2 → O2 + H2 k6 = 5.40×10^-12 cm^3 s^-1 (9) OH + HO2 → O2 + H2O2 k9 = 4.00×10^-11 cm^3 s^-1 (10) HO2 + HO2 → O2 + H2O2 k10 = 2.50×10^-12 cm s^-1 (11) O + O2 + M → O3 + M k11 = 1.05×10^-34 cm^6 s^-1 (14) H + O2 + M → HO2 + M k14 = 8.08×10^-32 cm^6 s^-1 (15) H + H + M → H2O + M k15 = 3.31×10^-27 cm^6 s^-1 (16) O2 + hv → 2 O k16 = (1.26×10^-8 s^-1) φ (17) H2O + hv → H + OH k17 = (3.4×10^-6 s^-1) φ (18) O3 + hv → O2 + O k18 = (7.10×10^-5 s^-1) φ

Table 1 Reactions, rate constants and activation energies used in the model* No. Reaction kopt (M⁻¹ s⁻¹) 1 OH + H₂ → H + H₂O 3.74 x 10⁷ 2 OH + HO₂ → HO₂ + OH⁻ 5 x 10⁹ 3 OH + H₂O₂ → HO₂ + H₂O 3.8 x 10⁷ 4 OH + O₂ → O₂ + OH 9.96 x 10⁹ 5 OH + HO₂ → O₂ + H₂O 7.1 x 10⁹ 6 OH + OH → H₂O₂ 5.3 x 10⁹ 7 OH + e⁻aq → OH⁻ 3 x 10¹⁰ 8 H + O₂ → HO₂ 2.0 x 10¹⁰ 9 H + HO₂ → H₂O₂ 2.0 x 10¹⁰ 10 H + H₂O₂ → OH + H₂O 3.44 x 10⁷ 11 H + OH → H₂O 1.4 x 10¹⁰ 12 H + H → H₂ 1.94 x 10¹⁰ 13 e⁻aq + O₂ → O₂⁻ 1.9 x 10¹⁰ 14 e⁻aq + O₂ → HO₂⁻ + OH⁻ 1.3 x 10¹⁰ 15 e⁻aq + HO₂ 2.0 x 10¹⁰ 16 e⁻aq + H₂O₂ 1.1 x 10¹⁰ 17 e⁻aq + HO₂ → OH + OH⁻ 1.3 x 10¹⁰ 18 e⁻aq + H⁺ → H 2.3 x 10¹⁰ 19 e⁻aq + e⁻aq → H₂ + OH⁻ + OH⁻ 2.5 x 10⁹ 20 HO₂ + O₂ → O₂ + HO₂ 1.3 x 10⁹ 21 HO₂ + HO₂ → O₂ + H₂O₂ 8.3 x 10⁵ 22 HO₂ + HO₂ → O₂ + OH + H₂O 3.7 23 HO₂ + HO₂ → O₂ + O₂ + OH + H₂O 7 x 10⁵ s⁻¹ 24 H⁺ + O₂⁻ → HO₂ 4.5 x 10¹⁰ 25 H⁺ + O₂⁻ → O₂ 2.0 x 10¹⁰ 26 H⁺ + OH⁻ 1.4 x 10¹¹ 27 H⁺ + HO₂⁻ 2 x 10¹⁰ 28 H₂O₂ → HO₂ + H⁺ + OH⁻ 2.5 x 10⁻⁵ s⁻¹ 29 H₂O₂ → H⁺ + OH⁻ 1.4 x 10⁻⁷ s⁻¹ 30 O₂ + O₂ → O₂ + HO₂ + OH⁻ 0.3 31 O₂ + H₂O₂ → O₂ + OH + OH 16 32

(2) O3 + H → O2 + OH k2 = 1.78×10^-11 cm^3 s^-1 (3) O + OH → O2 + H k3 = 4.40×10^-11 cm^3 s^-1 (5) O + HO2 → O2 + OH k5 = 3.50×10^-11 cm^3 s^-1 (6) H2O + O → 2 OH k6 = 5.40×10^-12 cm^3 s^-1 (9) OH + HO2 → O2 + H2O k9 = 4.00×10^-11 cm^3 s^-1 (10) HO2 + HO2 → O2 + H2O2 k10 = 2.50×10^-12 cm s^-1 (11) O + O2 + M → O3 + M k11 = 1.05×10^-34 cm^6 s^-1 (14) H + O2 + M → HO2 + M k14 = 8.08×10^-32 cm^6 s^-1 (15) OH + H + M → H2O + M k15 = 3.31×10^-27 cm^6 s^-1 (16) O2 + hv → 2 O k16 = (1.26×10^-8 s^-1) φ (17) H2O + hv → H + OH k17 = (3.4×10^-6 s^-1) φ (18) O3 + hv → O2 + O k18 = (7.10×10^-8 s^-1) φ