I have a convex polygon ABCDE... (it can have any number of points). I need to sort all its vertexes so none of the edges will intersect.
example:
A ____
Assuming your points are all on the convex hull of your polygon, you can use the following:
choose two points on the polygon. the midpoint of the line will be contained within that polygon. Let that point be M.
Then, sort the points based on the angle based from M (along the X axis), breaking degeneracy based on distance from M. Iterating in that order ensures that no two edges will intersect.