This is a pre-release version (2.0.0.dev0+git20260907.41eeb59).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy 2.0.0.dev0+git20260907.41eeb59 / scipy / spatial / transform / _rotation / Rotation / concatenate

staticmethod

scipy.spatial.transform._rotation:Rotation.concatenate

source: build-install/usr/lib/python3.14/site-packages/scipy/spatial/transform/_rotation.py:1518

Signature

staticmethoddef concatenate(rotations: Rotation | Sequence[Rotation]) → Rotation

Summary

Concatenate a sequence of Rotation objects into a single object.

Extended Summary

This is useful if you want to, for example, take the mean of a set of rotations and need to pack them into a single object to do so.

Parameters

rotations : sequence of `Rotation` objects

The rotations to concatenate. If a single Rotation object is passed in, a copy is returned.

Returns

concatenated : `Rotation` instance

The concatenated rotations.

Notes

Examples

from scipy.spatial.transform import Rotation as R
r1 = R.from_rotvec([0, 0, 1])
r2 = R.from_rotvec([0, 0, 2])
rc = R.concatenate([r1, r2])
rc.as_rotvec()
✓
array([[0., 0., 1.],
       [0., 0., 2.]])
rc.mean().as_rotvec()
✗
array([0. , 0. , 1.5])
Concatenation of a split rotation recovers the original object.
rs = [r for r in rc]
R.concatenate(rs).as_rotvec()
✓
array([[0., 0., 1.],
       [0., 0., 2.]])
Note that it may be simpler to create the desired rotations by passing in a single list of the data during initialization, rather then by concatenating:
R.from_rotvec([[0, 0, 1], [0, 0, 2]]).as_rotvec()
✓
array([[0., 0., 1.],
       [0., 0., 2.]])

Aliases

  • scipy.spatial.transform.Rotation.concatenate