Re: [Plib-users] Geometry library?
Brought to you by:
sjbaker
From: Marlin M. <mar...@ho...> - 2001-04-29 15:57:01
|
>From: Steve Baker <sjb...@ai...> >Marlin Mixon wrote: > > I needed to compute 2-D line segment intersections. I looked through >plib > > and saw some 3D intersection routines, but no 2D. > [SNIP] > > 3) Contribute the resulting function to the library (please!). > >Things are a little simpler for 2D lines than for 3D because you *know* >that two infinite 2D lines will definitely intersect (unless they are >parallel). > >You should be able to form a parametric equation for each line that takes >the value zero at one end of the line and 1.0 at the other...finding the >intersection in parametric space of infinite lines is then quite easy and >you can just test the value of the parameter for each line. That sounds interesting, but I'm not familiar with the parametric techniques you are describing. Do you mean like for the general form of the line AX + BY + C = 0, the parameters are A,B & C? Or is it something completely different? One feature about the sweep method that I found is it's more than just intersection, it also helps you considerably narrow down the lines to compare: normally you want to compare each line with every other line but the sweep method has you comparing neighbors based on a vertical sweep line, so the actual intersection determination is just one part of a solution.+ <- sorry, purring cat walked on the keyboard. Also, I will gladly contribute any code that I write that is within the scope of PLIB. Marlin _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com |