title: Sorting clockwise polygon points in MATLAB
body: <p>I have 2 vectors that are x and y coordinates of the 8 vertexes of a polygon</p>
  <blockquote>
  <p>x=[5 5 7 7 9 9 5 7]</p>
  <p>y=[8 6 6 8 6 8 10 10]</p>
  </blockquote>
  <p>I wanna sort them (clockwise) to obtain the right vectors (to draw the polygon correctly)</p>
  <blockquote>
  <p>x=[5 7 9 9 7 7 5 5]</p>
  <p>y=[6 6 6 8 8 10 10 8]</p>
  </blockquote>