title: How can I rotate a 3d array (nxnxn) by x degrees around x, y, and z axes?
body: <p>I have a 3d array created with numpy, and I was wondering how I can rotate it by a custom angle, not just the <code>rot90</code> function that numpy has. Can anyone help?</p>
  
  <p>The 3d matrix represents an image (such as a cube, or some other shape) ie</p>
  
  <pre><code>0:
  1 1 1
  1   1
  1 1 1
  
  1:
  1   1
  
  1   1
  
  2:
  1 1 1
  1   1
  1 1 1
  </code></pre>
  
  <p>EDIT:
  Moved solution to answer</p>