code: def get_kabsch_rotation(Q, P):
      
      # Naming of variables follows the wikipedia article:
      # http://en.wikipedia.org/wiki/Kabsch_algorithm
      A = np.dot(np.transpose(P), Q)
      # One can't initialize an array over its transposed
      V, S, W = np.linalg.svd(A)  # pylint:disable=unused-variable
      W = W.T
      d = np.linalg.det(np.dot(W, V.T))
      return np.linalg.multi_dot((W, np.diag([1., 1., d]), V.T))
docs: Calculate the optimal rotation from ``P`` unto ``Q``.
  
      Using the Kabsch algorithm the optimal rotation matrix
      for the rotation of ``other`` unto ``self`` is calculated.
      The algorithm is described very well in
      `wikipedia <http://en.wikipedia.org/wiki/Kabsch_algorithm>`_.
  
      Args:
          other (Cartesian):
  
      Returns:
          :class:`~numpy.array`: Rotation matrix