I have a convex polygon expressed by points. Points are expressed by array of x-coordinates and array of y-coordinates.
For example:
X = {6, 1, 5, 0, 3}
Y = {4, 0, 0, 4, 6}
How can I sort this points by clockwise? Number of points is not always the same, but polygon is still convex.
Is there a solution without using atan2 or other function from math.h?