rigid_body_motion.transform_quaternions¶
- rigid_body_motion.transform_quaternions(arr, into, outof=None, dim=None, axis=None, timestamps=None, time_axis=None, return_timestamps=False)[source]¶
Transform an array of quaternions between reference frames.
- Parameters
- arr: array_like
The array to transform.
- into: str or ReferenceFrame
ReferenceFrame instance or name of a registered reference frame in which the array will be represented after the transformation.
- outof: str or ReferenceFrame, optional
ReferenceFrame instance or name of a registered reference frame which is the current reference frame of the array. Can be omitted if the array is a DataArray whose
attrs
contain a “reference_frame” entry with the name of a registered frame.- dim: str, optional
If the array is a DataArray, the name of the dimension representing the spatial coordinates of the quaternions.
- axis: int, optional
The axis of the array representing the spatial coordinates of the quaternions. Defaults to the last axis of the array.
- timestamps: array_like or str, optional
The timestamps of the quaternions, corresponding to the time_axis of the array. If str and the array is a DataArray, the name of the coordinate with the timestamps. The axis defined by time_axis will be re-sampled to the timestamps for which the transformation is defined.
- time_axis: int, optional
The axis of the array representing the timestamps of the quaternions. Defaults to the first axis of the array.
- return_timestamps: bool, default False
If True, also return the timestamps after the transformation.
- Returns
- arr_transformed: array_like
The transformed array.
- ts: array_like
The timestamps after the transformation.
See also