Xref: utzoo comp.graphics:1796 comp.sys.ibm.pc:12407 Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!pyramid!amdcad!msprick From: msprick@amdcad.AMD.COM (Rick Dorris) Newsgroups: comp.graphics,comp.sys.ibm.pc Subject: Re: COMPLICATED PROBLEM; ONLY INTELLIGENT PEOPLE SHOULD READ Message-ID: <20533@amdcad.AMD.COM> Date: 25 Feb 88 18:26:06 GMT References: <971@ut-emx.UUCP> Reply-To: msprick@amdcad.UUCP (Rick Dorris) Organization: Advanced Micro Devices Lines: 16 Keywords: READ THIS ONLY IF YOUR IQ >>125 In article <971@ut-emx.UUCP> jezebel@ut-emx.UUCP (Jim @ MAC@/) writes: >Have a nice one here: >Have a boundary defined on the screen. Boundary is composed of points >joined by lines... Now some random points are generated and I want to check >if a given point is within or outside the existing boundary.. Any algorithm for >this ? Is it at all possible ???? >Jim Well not to say that I'm intelligent, but here's a solution. You can figure if the point is within the boundary by drawing a line from the point to the edge of the screen. Count how many times this line crosses your boundary. If odd, the point is inside the boundary, if even, it is not. If I understood your problem correctly, this should work. How to actually program this--- well I told you that I wasn't that intelligent! Rick