Rv

Contents

Rv#

mrinufft.trajectories.maths.rotations.Rv(v1, v2, eps=1e-08, *, normalize=True)[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 (NDArray) – Source vector.

  • v2 (NDArray) – Target vector.

  • eps (float, optional) – Tolerance to consider two vectors as colinear. The default is 1e-8.

  • normalize (bool, optional) – Normalize the vectors. The default is True.

Returns:

3D rotation matrix.

Return type:

NDArray