title: Ordering a set of points in 3D space
body: <p>I have a set of coordinates in a 3D system, the points are generated randomly. I've trying to order them based on their position in Room ,without any sign of  <a href="https://i.stack.imgur.com/1Q48U.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1Q48U.jpg" alt="enter image description here"></a>success.</p>
  
  <p>what I want to do is to get a  order a way that looks more like a helix.</p>
  
  <p><a href="https://i.stack.imgur.com/BoV3d.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BoV3d.png" alt="enter image description here"></a></p>
  
  <p>I've tried to order the X's,Y's and Z's to get the helix curve but  the result was even worst, in the image you can see point Nr 29 in the wrong position! </p>
  
  <p>can anyone here give me a hint about how can I order them.
  PS: the set of the points can changed for that I need to have a logic behind the order + I'm NOT asking for code!! </p>
  
  <p>thanks in advance ! </p>