title: Use NumPy for 3D vectors
body: <p>I must admit, I'm not so bad in Python, but not so good in math.  There, I said it.  I'm planning on building a game with a coordinate system in 3D.  Classic, really simple.  Like my first room would be 0, 0, 0, and the one on the east would be 1, 0, 0.</p>
  
  <p>What would be a bit more difficult is that I would need to search through these coordinates.  Find, for instance, all rooms that are around a X,Y,Z coordinate in a 3-rooms radius, let's say.  I may use it for pathfinding as well.  So I was thinking of using NumPy for performance (since I have no idea how many coordinates there will be in the end) and so something quite simple:</p>
  
  <pre><code>import numpy as np
  a = np.array([0.0, 0.0, 0.0])
  b = np.array([1.0, 0.0, 0.0])
  </code></pre>
  
  <p>But that's where my meager skills reach a dead end.  In theory I could substract one to the other to get the absolute distance, but even for that I'm stuck, it seems.  So I'll put my needs here... and hope someone can help me figure things out:</p>
  
  <ol>
  <li>Return the distance between two vectors (as an int, or float would be better).</li>
  <li>Look for vectors close to another: the notion of close would be a distance, so in theory, that would mean browsing through all vectors and getting their distance to another one.  I don't know if it's great in terms of performance though.</li>
  <li>Obtaining both the 2D direction (in degrees or radiants, between A and B) and the vertical direction (same thing, but using the Z coordinate).</li>
  <li>"Turning" a vector, keeping its distance (norm) but in a different direction, which would imply pivoting around the Z coordinate, if that makes sense. The same thing to pivot around X or Y would be great.</li>
  <li>Normalize this vector, so it would be in the same "direction" but with only a distance (norm) of 1 from 0,0,0,.</li>
  </ol>
  
  <p>I'm sorry if that doesn't make much sense.  My use case is pretty clear in my head, but not knowing vectors very much, perhaps I'm missing on one or more simple concepts.</p>
  
  <p>Thanks for your help!</p>