RE: [Algorithms] 3d Lines Intersection
Brought to you by:
vexxed72
From: Graham S. R. <gr...@se...> - 2000-08-07 14:21:16
|
There is a nice closed form solution for this determinant (since the matrix is small). I worked it out a few years ago, and I *might* still have it lying around somewhere. (It was sent to some newsgroup.) I'll see if I can dig it up or redo it if anyone is interested and doesn't want to take the time to do it themselves. Graham Eric Haines wrote, > -----Original Message----- > I looked it up on my 3D objects intersection page: > http://www.realtimerendering.com/int/. I really need > to find time to put down actual algorithms and code > on this page (anyone want to give me a grant? ;^> ). > > Anyway, for two lines P1 _ V1*t and P2 + V2*s, where V1 and V2 are > the direction vectors and P1 & P2 some points on the lines, the answer is: > > s = Determinant{(P2-P1),V1,V1 X V2} / | V1 X V2 |^2 > > If the lines are parallel, the denominator is 0. If the lines are skew > (don't intersect), s and t represent the parameters of the points of > closest approach - measure the distance between these two points and > you'll know how far apart they are. Eric |