Log in

View Full Version : Object overlap question



talleyman
08-17-2011, 10:06 PM
Hi all, my last question was so brilliantly answered that I thought I might be able to find some more help here on the forums about a project I'm working on. In my project I need to generate a random x and y coordinate for a point and then, using code, determine which of 5 "zones" the point falls in. Here are the details and the tricky parts:

1. The zones radiate outward from the smallest (we can call it the bulls-eye) out to the largest.
2. Each zone is contained completely within all of the zones larger than it, kind of like a target with the bulls-eye completely contained in all other circles, the next ring out from the bulls-eye contained in all circles larger than it, etc.
3. The zones are not centered over on another like circles in a target.
4. The tricky part for me - the zones will not be perfect circles or squares. Best case scenario is that each zone will be an oval, worst case scenario is that each zone will be irregularly shaped with up to 30 or so nodes :(

So, given a slide with these 5 zones is there a way to check which of the zones a randomly generated point will fall in? I just know there's a good mathematical way to do this, but I can't wrap my brain around it and visualize the VBA (ironically). Any help would be greatly appreciated. Thanks!

- Luke

Andy Pope
08-22-2011, 04:31 AM
Although this is a excel example you may find it helps.

http://www.andypope.info/ngs/ng5.htm