How do I go about computing the distance between a point and a line in 4-D?

45 Views Asked by At

The point p = (1,1,1,1) ∈ R^4 (real numbers) to the line L(a) with a = (1,2,3,4) in particular. I tried it as follows:

The distance d(p,L(a)) is the orthogonal projection of p onto L(a). So the dot product equals zero. Out of this follows

L(a) = c * a , with c = (c_1, c_2, c_3, c_4) and c_1, c_2, c_3, c_4 elements in the real numbers Then

dot product of c*a,p = 0, so

1c_1 + 2c_2 + 3c_3 + 4c_4 = 0

and I'm getting stuck here and to be honest I feel like I'm going about this all wrong... I hope someone can give me a hint or a push in the right direction. Thank you kindly for your time.

Edit:

I think I found the solution: I'm looking for a vector v_2 that is the orthogonal projection of p onto L(a) take c = dotprod(a,p)/dotprod(a,a) = 10/30 = 1/3

v_1 = c*a = 1/3 * (1,2,3,4)

v_2 = v - v_1 = (1,1,1,1) - 1/3* (1,2,3,4) = (-2/3, -1/3, 0, 1/3)

The displacement of v_2 = |v_2| = 1/5 sqrt((-2/3)^2 + (-1/3)^2 + (0)^2 + (1/3)^2) and v_2 = d(p,L(a))

am I close?

2

There are 2 best solutions below

2
On

Just use the formula for projection. See definition 1.1 of https://en.wikibooks.org/wiki/Linear_Algebra/Orthogonal_Projection_Onto_a_Line

2
On

You can do this in exactly the same way as in 2 dimensions: find the point $b$ on the line so that $b-a$ is perpendicular to the line. Let the line be $\{ct+d:t \in \mathbb{R}\}$, then if $b=ct+d$, this says $t$ has to satisfy $$ 0=c \cdot (b-a)= c \cdot (ct+d-a), $$ so $$ t = -\frac{c \cdot(d-a)}{\lVert c \rVert^2}, $$ so $$ b = d-\frac{c \cdot(d-a)}{\lVert c \rVert^2}c, $$ and $$ \lVert b-a \rVert^2 = \lVert d-a \rVert^2 - \frac{(c \cdot (d-a))^2}{\lVert c \rVert^2} $$