pytransform3d.rotations.axis_angle_from_two_directions(a, b)[source]

Compute axis-angle representation from two direction vectors.

The rotation will transform direction vector a to direction vector b. The direction vectors don’t have to be normalized as this will be done internally. Note that there is more than one possible solution.

aarray-like, shape (3,)

First direction vector

barray-like, shape (3,)

Second direction vector

aarray, shape (4,)

Axis of rotation and rotation angle: (x, y, z, angle). The angle is constrained to [0, pi].

Examples using pytransform3d.rotations.axis_angle_from_two_directions