title: Arranging coordinates into clockwise order
body: <p>I have 9 screen coordinates, each representing one of 9 positions. From the top right, I want that position to start as the 1st position, and the following clockwise coordinates to represent the 2nd, 3rd, 4th and so on, up until the 9th, which would be the top left coordinate.</p>
  
  <p>Would anybody here be able to come up with some sort of mathematical means of determining which of the 9 coordinates is in which position? They're all relative to each other, and will always be THAT relative to each other.</p>
  
  <p>Example coordinates could be:</p>
  
  <pre><code>(x,y)
  X   Y
  663 382
  543 454
  303 454
  183 382
  418 459
  543 209
  303 209
  653 259
  183 259
  </code></pre>
  
  <p>Plotting into an image something like:
  <img src="https://i.stack.imgur.com/DjMjU.png" alt="Representation of coordinates"></p>
  
  <p>Would anybody have any ideas? I simply want some form of programmatic way of listing these coordinates in clockwise order...</p>