From: Einstein Newsgroups: comp.os.msdos.djgpp Subject: Re: ALLEGRO : check for Line intersecting a point . . . how? Date: Tue, 26 Aug 1997 07:52:35 +0800 Organization: n/a Lines: 25 Message-ID: <34021AC3.73F80277@usa.net> References: NNTP-Posting-Host: ip-49-104.dialup.hkstar.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Given 3 points, you can know whether they are collinear or not without plotting the line. Just build the equation from any two of them, then substitute the third one into the equation. Check for some zero or nearly zero value. Einstein einstein DOT lam AT usa DOT net > On Thu, 14 Aug 1997, Thomas Harte wrote: > > > Hi > > > > I want to know in Allegro if a line I draw intersects a point I know. Is > > there a way to do this using Allegro, or should I just implement my own line > > algorithm? The reason I ask is that I am doing the level editor for my next > > project, and obviously when you try to click and drag a line it would be > > necessary for me to know which line you are attempting to click and drag . . . > > > > Or, can you think of another way for me to do this? There is in theory > > no maximum number of lines on screen, although maps above a certain complexity > > probably won't be created for runtime speed reasons if nothing else. > > > > -Thomas