Am 26.07.2013 16:26, schrieb Bart Goddard: > William Elliot <firstname.lastname@example.org> wrote in > news:Pine.NEB.email@example.com: > >> How do we find the shortest distance between two lines L, L' in R^3 > > Each line has a direction vector. The cross product n of the two > direction vectors is perpendicular to both lines. Pick a point > on each line, P and Q. The projection of the vector from P to Q > onto the vector n is the distance.
That's nice and simple. However the situation in R^3 seems to be special:
Let L: s -> v0 + s*v, L': t -> w0 + t*w. Suppose v and w aren't parallel then there are exactly two unit vectors n1 and n2 that are perpendicular to v and w. Furthermore n1 = -n2. You can compute them easily via the vector (cross) product in R3: n1,n2 = +- (vxw)/norm(vxw). Then the distance D(L,L') between the lines L and L' is given by
(A): D(L,L') = |<vxw,v0-w0>/(norm(vxw))|, <,> the scalar product.
Again, what makes this special is that in R^3 you only have one line through the origin which is perpendicular to the plane spanned by v and w. In R^n this is a hyperplane of dimension n-2.
On the other hand, using variational principles it is easy to compute D(L,L') for all n>=2 just using the euclidean structure, i.e. scalar products. I got the following general result (using Matlab-Notation for matrices and vectors):
Let L: s -> v0 + s*v, L': t -> w0 + t*w be non-parallel lines. Let M=[<w,w>,<v,w> ; <v,w>,<v,v>]/(<v,v><w,w> - <v,w>^2), [S;T] = M*[<v,w0-v0>;<w,v0-w0>].
Then D(L,L') = norm(v0+S*v-(w0+T*w)).
(I derived this in the accompanying thread). This even works for n=2, giving D(L,L')=0.
************ Question: Is there a generalization of the vector-product solution (A) to higher dimensional euclidean space R^n, n>3 using some sort of generalized vector-product? ************