rigid_body_motion.transform_coordinates

rigid_body_motion.transform_coordinates(arr, into, outof=None, dim=None, axis=None, replace_dim=True)[source]

Transform motion between coordinate systems.

Parameters
arr: array_like

The array to transform.

into: str

The name of a coordinate system in which the array will be represented after the transformation.

outof: str, optional

The name of a coordinate system in which the array is currently represented. Can be omitted if the array is a DataArray whose attrs contain a “coordinate_system” entry with the name of a valid coordinate system.

dim: str, optional

If the array is a DataArray, the name of the dimension representing the coordinates of the motion.

axis: int, optional

The axis of the array representing the coordinates of the motion. Defaults to the last axis of the array.

replace_dim: bool, default True

If True and the array is a DataArray, replace the dimension representing the coordinates by a new dimension that describes the new coordinate system and its axes (e.g. cartesian_axis: [x, y, z]). All coordinates that contained the original dimension will be dropped.

Returns
arr_transformed: array_like

The transformed array.