title: python implementation of 3D rigid body translation and rotation
body: <p>I've been trying to work out how to solve the following problem using python:</p>
  
  <ol>
  <li>We have points a, b, c, d which form a rigid body</li>
  <li>Some unknown <strong>3D</strong> translation and rotation is applied to the rigid body</li>
  <li>We now know the coordinates for a, b, c</li>
  <li>We want to calculate coordinates for d</li>
  </ol>
  
  <p>What I know so far:</p>
  
  <ul>
  <li>Trying to do this with "straightforward" Euler angle calculations seems like a bad idea due to gimbal lock etc.</li>
  <li><p>Step 4 will therefore involve a transformation matrix, and once you know the rotation and translation matrix it looks like this step is easy using one of these:</p>
  
  <ul>
  <li><a href="http://www.lfd.uci.edu/~gohlke/code/transformations.py.html">http://www.lfd.uci.edu/~gohlke/code/transformations.py.html</a></li>
  <li><a href="https://pypi.python.org/pypi/euclid/0.01">https://pypi.python.org/pypi/euclid/0.01</a></li>
  </ul></li>
  </ul>
  
  <p>What I can't work out is how I can calculate the rotation and translation matrices given the "new" coordinates of a, b, c.</p>
  
  <p>I can see that in the general case (non-rigid body) the rotation part of this is <a href="http://en.wikipedia.org/wiki/Wahba%27s_problem">Wahba's problem</a>, but I think that for rigid bodies there should be some faster way of calculating it directly by working out a set of orthogonal unit vectors using the points.</p>