pytransform3d.batch_rotations.batch_concatenate_quaternions

pytransform3d.batch_rotations.batch_concatenate_quaternions(Q1, Q2, out=None)[source]

Concatenate two batches of quaternions.

We use Hamilton’s quaternion multiplication.

Suppose we want to apply two extrinsic rotations given by quaternions q1 and q2 to a vector v. We can either apply q2 to v and then q1 to the result or we can concatenate q1 and q2 and apply the result to v.

Parameters:
Q1array-like, shape (…, 4)

First batch of quaternions

Q2array-like, shape (…, 4)

Second batch of quaternions

outarray, shape (…, 4), optional (default: new array)

Output array to which we write the result

Returns:
Q12array, shape (…, 4)

Batch of quaternions that represents the concatenated rotations

Raises:
ValueError

If the input dimensions are incorrect