1

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 :)

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
user1577191
  • 103
  • 7

1 Answers1

0

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

dreamzor
  • 5,795
  • 4
  • 41
  • 61