rotation_aligning_vectors#
- rotation_aligning_vectors(initial_vector, target_vector=[1, 0, 0], convention=None)[source]#
Compute the rotation matrix or Euler angles required to align an initial vector with a target vector.
- Parameters:
- initial_vectorNDArray
The initial vector to be rotated.
- target_vectorNDArray, optional
The target vector to align the initial vector with. Default is [1, 0, 0].
- conventionstr, optional
The generate euler angles in degrees. If None returns a rotation matrix instead.
- Returns:
- rotation_matrix_or_anglesNDArray or tuple
Rotation matrix if convention is None else tuple of euler angles.