G’day everyone,
I have a 2d graph which has some points plotted on it.
What I need to do is get only the outer most points so that I can connect them up (isn’t really relevant).
What I can’t seem to wrap my head around is the algorithm that I need to use in order to do this?
I think this might help you understand what I want to achieve:
o o o
o x o
o o o
All the o’s I want to get and the x I want to ignore. Also, the points can be in any position and any shape but I still want to only grab the outer most points.
Any ideas?
Also, I am not sure if this is the correct site to ask this on so if its not, please let me know where to go.
Thanks!
You need to do a convex hull of the set of points that you have. I personally prefer to use Graham scan for this as it is fairly easy to implement and has good computational complexity.