Results 1 to 8 of 8

Math Help - 2 overlapping polygons (not sure if this is college level math, but...)

  1. #1
    Newbie Dragon 2075's Avatar
    Joined
    Sep 2005
    Posts
    4

    2 overlapping polygons (not sure if this is college level math, but...)

    What I'm trying to find - On a normal X, Y coordinate plane, I'm trying to find a formula or group of formulas to find at which point two polygons overlap. The main problem with this is that this includes irregular polygons of any varying amount of sides. All I really know are the points and their order.

    Why - I'm trying to implement color into a 3d true basic program. For anyone who hasn't worked with true basic, it doesn't understand depth. (I'll point out at this point that I know there's a download to add that to it, but I'm trying to see if I can do this anyway. Besides, I don't think my school is going to let me install the extras for that.) All and all, I've got wire frame support set up, and it works fairly well. But since it doesn't know depth, if I were to add color to it, I'd need a way to order what I'm drawing. Otherwise, something in back of something else could be drawn on top of it. So, I figure that I could check each group of polygons to figure out if they're overlapping. If they are, the I just pick a point that they have in common, find the placement on the z-axis, and it's all fairly simple from there. (Side Note: The z-axis is something that I have it change in the background, but it doesn't know what to do with it plot-wise)

    So there's my problem. I'm not sure if this is really college level math, but I'm guessing it is. I'm in high school right now, and I've yet to find a teacher who knows how to do this.

    Thanks for the help.

    PS - If you have True basic, and would like to see the programs, I could send them to you. But they're a bit of a mess right now. (haven't cleaned them up code-wise)
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Senior Member
    Joined
    Jun 2005
    Posts
    295
    Awards
    1
    Are your polygons all convex? If so, then they overlap if and only if there's a vertex of one inside the other. Now 'all' you need is a way to determine whether a point is inside a polygon.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie Dragon 2075's Avatar
    Joined
    Sep 2005
    Posts
    4
    Well, to answer you question, yes, they're all convex. (I needed that setup for a different problem)

    But as for it only overlapping if a vertex of one is in the other, that's not always true. Consider this setup of the attached file. Both are convex, and overlap, but none of the vertexes are within the other polygon.

    Either way, thanks for the help. I've been going at this one for a while now, and it's nice to have people helping out.
    Attached Thumbnails Attached Thumbnails 2 overlapping polygons (not sure if this is college level math, but...)-overlap.gif  
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Senior Member
    Joined
    Jun 2005
    Posts
    295
    Awards
    1
    Oops!
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie Dragon 2075's Avatar
    Joined
    Sep 2005
    Posts
    4
    I was just thinking... perhaps there is something that can be done with the various y<mx+b equations that each would have? I'm to tired right now to think about it, plus I've got school in about an hour, but it seems like it would be a good place to start.

    Also, don't feel bad about making that mistake. I thought for a good while that it could be done by finding where the lines intersect until I realized one could be inside the other.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    hpe
    hpe is offline
    Member hpe's Avatar
    Joined
    Apr 2005
    Posts
    158
    Take a look a quick-hull, implemented as a java applet here and available as a standalone program here. You'll also find more information on each of these site.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Newbie Dragon 2075's Avatar
    Joined
    Sep 2005
    Posts
    4
    This looks like it could be what I'm looking for, though, again, I posting before school, and am a bit to tired to figure out exactly how to implement it for what I need.

    Thanks for pointing that out.
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Newbie
    Joined
    Nov 2005
    Posts
    21
    It might also be possible to check whether the edges of the polygons intersect; that only happens if the polygons overlap.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. A Few College Level Math Questions...
    Posted in the Algebra Forum
    Replies: 1
    Last Post: March 28th 2010, 06:35 PM
  2. Probabililty -college level
    Posted in the Statistics Forum
    Replies: 2
    Last Post: November 16th 2009, 07:04 PM
  3. Stats - College level
    Posted in the Advanced Statistics Forum
    Replies: 3
    Last Post: June 12th 2008, 07:55 PM
  4. Statistics - College Level - Again!
    Posted in the Advanced Statistics Forum
    Replies: 2
    Last Post: May 31st 2008, 06:06 AM
  5. Statistics - College Level
    Posted in the Advanced Statistics Forum
    Replies: 1
    Last Post: May 29th 2008, 11:23 PM

Search Tags


/mathhelpforum @mathhelpforum