Question

I am making one algorithm a day, and didn't make to finish this one recently.

I have a set of points that i draw, and now I'd like to chose pairs to draw lines between them so that when it's done they will form a convex hull.

My idea was to start from the one that has the lowest y- coordinate, and then go in CCW order, but I am not sure how to write a good algorithm for choosing the pairs.

This question is in fact very simple, it's just me who is a beginner :)

Was it helpful?

Solution

Have you tried using the Graham scan algorithm? It actually uses coordinate-sorting and CW order.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top