Path: utzoo!attcan!uunet!zephyr.ens.tek.com!vice!bobb From: bobb@vice.ICO.TEK.COM (Bob Beauchaine) Newsgroups: comp.lang.pascal Subject: Re: Text windows Message-ID: <6297@vice.ICO.TEK.COM> Date: 13 Nov 90 22:59:19 GMT References: <7187@hub.ucsb.edu> Distribution: comp Organization: Tektronix Inc., Beaverton, Or. Lines: 23 In article <7187@hub.ucsb.edu> 6600bori@ucsbuxa.ucsb.edu (Boris Burtin) writes: >I have been working on a text windowing program in Turbo Pascal, and just have >one question. I have a function that determines whether two windows overlap. >It currently does this by checking if one of the corners of one of the windows >is inside the other window. The problem is that I have not truly optimized the >coding. I have a long string and and/or statements that works, but gives me >a complex whenever I look at it. Does anyone have an algorithm for this kind >of problem? > - Boris Burtin > (6600bori@ucsbuxa.ucsb.edu) This seems to me another variation on the containment problem; i.e., how to decide if a given point lies within the boundary of a polygon whose vertices are known. I don't have my source for such algorithms with me, but I have seen several solutions to this problem. The book I like is _Fundamental_Algorithms_for_ Raster_Graphics (sorry, author unknown). You will need to know a bit about linear algebra, though, and may find the solution more trouble than it's worth. Bob Beauchaine bobb@vice.ICO.TEK.COM