Results 1 to 2 of 2

Thread: Generate Points in Polygon

  1. #1
    Sep 2008

    Generate Points in Polygon

    Hey all!

    I need to write a little application. My Basic Problem is i have a polygonal area which is not rectangular but isn't too complex as well, just a few vertex points building the polygonal area.

    So, i need to place random starting points in this polygonal area. I googled and googled and of course found quite some stuff. Most interesting is the "Ray Casting Algorithm" from Point in polygon - Wikipedia, the free encyclopedia and other sources, but what bothers me is the fact that it's a test on a point if it's in or out the poly. But what if i want to generate points in the Polygon? do i generate random coordinates within a bounding box of the polygon and test them if they're in the poly and if they are, i actually create them?? This doesn't sound very effective to me..

    Has anybody an idea or a hint on how to generate random coordinates within this polygonal area "directly"?

    Thanks a lot for any help.

    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor

    Aug 2006
    To be honest, I cannot say that I really follow what you are trying to do.
    But if the polygon is convex the you may explore lines of support.
    A convex polygon has all sides on the same side of a line of support.
    I suggest that you do a search on the terms “convex” and “line of support”.
    For a non-convex polygon, I think one would have to reduce it to convex sub-polygons.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. how to generate new formulas?
    Posted in the Trigonometry Forum
    Replies: 3
    Last Post: Nov 28th 2010, 06:52 AM
  2. generate
    Posted in the Advanced Algebra Forum
    Replies: 5
    Last Post: Nov 17th 2010, 10:51 AM
  3. How to generate this?
    Posted in the Geometry Forum
    Replies: 3
    Last Post: Feb 12th 2010, 10:47 AM
  4. generate the set of polynomials
    Posted in the Advanced Algebra Forum
    Replies: 1
    Last Post: Jan 24th 2010, 04:24 PM
  5. Does the following vectors generate R^3?
    Posted in the Advanced Algebra Forum
    Replies: 3
    Last Post: Feb 21st 2009, 11:25 AM

Search Tags

/mathhelpforum @mathhelpforum