home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!elroy.jpl.nasa.gov!usc!snorkelwacker.mit.edu!ai-lab!fiber-one!sundar
- From: sundar@fiber-one.ai.mit.edu (Sundar Narasimhan)
- Newsgroups: comp.graphics
- Subject: Re: Shortest distance between two line _segments_
- Date: 23 Nov 1992 20:37:10 GMT
- Organization: MIT Artificial Intelligence Laboratory
- Lines: 28
- Sender: sundar@fiber-one (Sundar Narasimhan)
- Distribution: world
- Message-ID: <1erfdmINNcnq@life.ai.mit.edu>
- References: <1992Nov21.000527.21786@zip.eecs.umich.edu> <By2z4D.How@slipknot.rain.com> <1992Nov22.112142.24512@sophia.smith.edu>
- Reply-To: sundar@ai.mit.edu
- NNTP-Posting-Host: fiber-one.ai.mit.edu
-
- In article <1992Nov22.112142.24512@sophia.smith.edu>, orourke@sophia.smith.edu (Joseph O'Rourke) writes:
- |> In article <By2z4D.How@slipknot.rain.com> robert@slipknot.rain.com.UUCP (Robert Reed) writes:
- |> >In article <1992Nov21.000527.21786@zip.eecs.umich.edu> katkere@engin.umich.edu writes:
- |> >|
- |> >|The problem I am trying to solve is whether two swept spheres intersect.
- |> >
- |> >Two spheres intersect if the sum of their radii is greater than or equal to the
- |> >distance between their centers.
- |>
- |> Perhaps what the original poster means by a swept sphere is the set
- |> of points obtained by sweeping a sphere along a line segment, which
- |> produces a cylinder with spherical endcaps.
- I'd think one can compute this using two independent computations.
- Let's say L1 L2 are the two lines.
-
- a. Determine the point P1 on linesegment L1 that is closest to L2.
- This can be done very easily if you express the co-ordinates of the
- endpoints of L1 in a plane perpendicular to L2, and then find the
- point of intersection between this projected segment and a perpendicular
- drawn to it from the origin. (Note that this is a 2-d problem). Let
- this point be Q. Determine the parametric value of Q in [P1 + t(P2-P1)]
- and choose one of Q, P1 or P2 depending on whether t is (0,1),<1,>1.
-
- b. Determine the point P2 on linesegment L2 that is closest to L1.
- (This is just the same as a. but with the arguments transposed).
-
- Desired distance = dist(P1,P2).
- Proof? You must be kidding! :-)
-