title: Sorting polygon's points
body: <p>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.<br>
  example:</p>
  
  <pre><code>A _____ B
    \   /
     \ /
      X
     / \
    /___\
  C       D
  </code></pre>
  
  <p>That polygon in ABCD order has intersecting edges. however in ABDC order:</p>
  
  <pre><code>A _____ B
    |   |
    |   |
    |   |
    |   |
    |___|
  C       D
  </code></pre>
  
  <p>None of the edges intersect so ABDC is the expected output.</p>
  
  <p>How can I do this?</p>