mvpa2.misc.plot.flat_surf.vector_alignment_find_rotation

mvpa2.misc.plot.flat_surf.vector_alignment_find_rotation(x, y)

Find rotation matrix to align one vector with another

Parameters:

x: np.ndarray

vector with 3 elements that is to be aligned

y: np.ndarray

vector with 3 elements to which y is to be aligned

Returns

r: np.ndarray

array of shape (3,3) so that the vector np.dot(r,x) points in the same direction as y, and has the same L2 norm as x