Find the bottom-most point by comparing y coordinate of all points. If there are two points with same y value, then the point with smaller x coordinate value is considered. Put the bottom-most point at first position.

Consider the remaining n-1 points and sort them by polor angle in counterclockwise order around points[0]. If polor angle of two points is same, then put the nearest point first.

How to compute angles?
One solution is to use trigonometric functions.
Observation: We don’t care about the actual values of the angles. We just want to sort by angle.
Idea: Use the orientation to compare angles without actually computing them!