two_vector_frame

giant.rotations.frames:

giant.rotations.frames.two_vector_frame(primary_vector, secondary_vector, primary_axis, secondary_axis, return_rotation=False)[source]

Compute a 2-vector frame given primary and secondary vectors and their corresponding axes.

Parameters:
  • primary_vector (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]) – The vector defining the primary axis

  • secondary_vector (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]) – The vector providing the constraint for the secondary axis

  • primary_axis (Literal['x', 'y', 'z']) – The axis corresponding to the primary vector (must be x, y, or z)

  • secondary_axis (Literal['x', 'y', 'z']) – The axis corresponding to the secondary vector (must be x, y, or z)

  • return_reotation – whether to return as a .Rotation object (True) or as a numpy array containing the rotation matrix

  • return_rotation (bool)

Returns:

rotation defining the transformation to go from the frame the primary and secondary vectors where expressed in to the 2-vector frame either as a 3x3 rotation matrix or as a .Rotation object

Return type:

ndarray[tuple[Any, …], dtype[float64]] | Rotation