Re: intersection and ExoticaX
- Posted by Jiri Babor <jbabor at PARADISE.NET.NZ> Jul 06, 2001
- 430 views
Jeff, if the line and side are parallel, or even identical, the case can be ignored, because the entry and exit points will be obtained as intersections with the adjacent sides. BTW, Jeff, I would like to have a look at your solution, unfortunately Lewis' note with it was truncated. jiri ----- Original Message ----- From: "Jeffrey Fielding" <jjprog at earthlink.net> To: "EUforum" <EUforum at topica.com> Sent: Saturday, 7 July 2001 06:15 Subject: Re: intersection and ExoticaX > > > On 2001.07.06 07:52 Jiri Babor wrote: > <snip> > > if D then -- if line and side not > > parallel > > c2 = -a2*x1 - b2*y1 > > x = (b1*c2 - b2*c1)/D > > y = (a2*c1 - a1*c2)/D > > if b2 then -- if side not vertical > > if (x >= x1 and x <= x2) or (x <= x1 and x >= x2) then > > s = append(s, {x,y}) > > end if > > else -- vertical side > > if (y >= y1 and y <= y2) or (y <= y1 and y >= y2) then > > s = append(s, {x, y}) > > end if > > end if > > end if > </snip> > > Nice. But what if the line and side are parallel? > > Jeff > > > > > >