Rv#
- mrinufft.trajectories.maths.Rv(v1, v2, normalize=True, eps=1e-08)[source]#
Initialize 3D rotation matrix from two vectors.
Initialize a 3D rotation matrix from two vectors using Rodrigues’s rotation formula. Note that the rotation is carried around the axis orthogonal to both vectors from the origin, and therefore is undetermined when both vectors are colinear. While this case is handled manually, close cases might result in approximative behaviors.
- Parameters:
v1 (np.ndarray) – Source vector.
v2 (np.ndarray) – Target vector.
normalize (bool, optional) – Normalize the vectors. The default is True.
- Returns:
3D rotation matrix.
- Return type:
np.ndarray