home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.graphics
- Path: sparky!uunet!caen!umeecs!krusty.eecs.umich.edu!katkere
- From: katkere@krusty.eecs.umich.edu (Arun Katkere)
- Subject: Shortest distance between two line _segments_
- Message-ID: <1992Nov21.000527.21786@zip.eecs.umich.edu>
- Followup-To: comp.graphics
- Keywords: shortest distance, line segments, swept spheres
- Sender: news@zip.eecs.umich.edu (Mr. News)
- Reply-To: katkere@engin.umich.edu
- Organization: University of Michigan EECS Dept., Ann Arbor, MI
- Date: Sat, 21 Nov 1992 00:05:27 GMT
- Lines: 33
-
- If I have two line segments ((x11, y11, z11), (x12, y12, z12)) and
- ((x21, y21, z21), (x22, y22, z22)), how can I find the shortest
- distance between them? Finding Shortest line between two lines is
- easy, but I couldn't think how I could do the same for segments.
-
- The problem I am trying to solve is whether two swept spheres
- intersect. It seems to be that if we find the shortest distance
- between the line segments formed by the sweeping of the centers of
- the two spheres and if this distance is less than the sum of the
- radii of the two spheres, then they intersect, else they don't.
- Hence, the query.
-
- I didn't really explain that well, did I?
- I'll try to draw that in 2D.
- ________________
- /| \
- / |r1 \
- | x|______________x | Well, this is how the cross section
- | | of one of the swept spheres looks.
- \ / If seg1 is the line segment between the
- \_______________/ two x's, and if radius and seg for
- sphere 2 is r2 and seg2, the two swept spheres intersect
- iff min_dist(seg1, seg2) < (r1+r2). I haven't really allocated
- much brain power to this, but the argument looks fine to me.
- The question is how do I compute min_dist()?
- Thanks,
- -arun
- --
- +-----------------------------------------------------------------------------+
- | Arun Katkere | The University of Michigan AI Lab |
- | katkere@engin.umich.edu | 147 ATL, 1101 Beal Avenue |
- | O:(313)763-1563 | R:(313)761-9462 | Ann Arbor, MI 48109-2110 |
- +-----------------------------------------------------------------------------+
-