Re: Algorithm to identify area in common?



No Such Luck wrote:

Suppose I have two rectangles existing in space (memory), and these two
rectangles are represented by their bounding box coorinates: top left
corner (x1, y1), bottom right corner (x2, y2). Is there an algorithm
that, when given the bounding box cooridinates of two of these
rectangles, will return the union of the areas of the rectangles, in
square units?

Yes, there are techniques for that. I suggest trying to work out a technique on paper. There will be several cases that you need to consider. If you then get stuck with your homework problem, post what you have done and what particular problem you are having.


Thad

.



Relevant Pages

  • Re: Overlapping items in the Tk canvas
    ... overlaps. ... but it's simply finding items prior to the tagOrId in the ... fall within the object (rectangles near the edge will do nicely). ... If not, the bounding box returned a false positive, otherwise you ...
    (comp.lang.tcl)
  • Modify stacking order of Tikz nodes
    ... The following code draws a Tikz matrix and, ... Fitting library, draws two filled-in rectangles, one at the bounding ...
    (comp.text.tex)
  • Re: Overlapping items in the Tk canvas
    ...   fall within the object (rectangles near the edge will do nicely). ... If not, the bounding box returned a false positive, otherwise you ... Dunno whether it works by analytic intersection or by ...
    (comp.lang.tcl)
  • Re: Algorithm to identify area in common?
    ... >> Suppose I have two rectangles existing in space, ... >> rectangles are represented by their bounding box coorinates: ... If you then get stuck with your homework problem, ... We know the rectangles do not overlap in any way if: ...
    (comp.programming)
  • Re: Bullets.
    ... > I actually want to programmatically insert rectangles behind bulleted text. ... > rectangles which exactly bound their respective bullet points. ... if I try to calculate the bounding box ... Steve Rindsberg, PPT MVP ...
    (microsoft.public.powerpoint)