• convex hull

 

I run into a problem on the last test case.

If points are on a straight line to my starting point they are skipped in my solution, but as they are on the convex hull they should be in there.

My solution works by sorting all points on their polar_angle to the starting point. These last points on a straight line back to the starting point however all have the same polar angle.

I am having trouble finding a secondary sorting criteria that allows me to include these points in the final solution.

My solution uses "Graham scan" algorithm (https://en.wikipedia.org/wiki/Graham_scan).

Any tricks?