pytransform3d.rotations.concatenate_quaternions(q1, q2)[source]

Concatenate two 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.

q1array-like, shape (4,)

First quaternion

q2array-like, shape (4,)

Second quaternion

q12array-like, shape (4,)

Quaternion that represents the concatenated rotation q1 * q2

Examples using pytransform3d.rotations.concatenate_quaternions