Isn't it "axi"?Create an x/y coordinate system and read the positions of the dots on the axis es. How do you spell the plural of axis?
Exactly my question.Apparently I misunderstood what you were asking for in the OP, but now I'm really not sure.
I thought you had a set of random points, some of which were inside the shape and some of which were outside the shape, and you wanted an algorithm to identify the points that are inside.
What are the "points" that you are talking about here?
How many points are we talking about, both border points and points that must be filtered?
How is that any different than my suggestion (see Post #3 for the original suggestion)?A point is inside the shape if a line from that point to infinity in any direction crosses the boundary an odd number of times. This might allow you to simplify WBahn's suggestion a little. Here's one suggestion for a line crossing algorithm
Interesting. Does it really help in this case? If I am starting from the bottom and working up (in terms of boundary points), it would seem that any point that is below the green line (the y-coordinate of the point under consideration) must be evaluated regardless of it's x-coordinate since I could find coordinates for the other point that would either force it to intersect or force it to not intersect. But I wonder if interleaving the y-coordinates and sorting on that might be useful.... Have to think about that.Just as aside, one way of sorting points for easier searching in some cases is to interleave the X and Y digits, so, represent all coordinates as say 4 digits (pad with leading zeros) and then add to a sorted list as xd1yd1xd2yd2xd3yd3xd4yd4 so the coordinate 0001,9990 becomes
09090910. This has the effect of putting coordinates that are "near" each other close together in the list and allows quick elimination of points which are far away from the area of concern.
Didn't say it was (and TBH didn't read the whole thread). I first wrote algorithms of this type in 1987 and have repeated the exercise a number of times since. I was just chipping-in my experience, not trying to steal anyone's thunder.How is that any different than my suggestion (see Post #3 for the original suggestion)?