warp.quat_between_vectors#
- warp.quat_between_vectors(a: vec3f, b: vec3f) quatf[source]#
Return the rotation quaternion that rotates the direction of
aonto the direction ofb.Currently, opposite directions are not handled. This condition is not checked, and such inputs can produce an incorrect rotation.
For opposite directions, use
warp.quat_from_axis_angle()instead, with any unit axis perpendicular toaand an angle ofpiradians. The resulting 180-degree rotation mapsnormalize(a)ontonormalize(b).- Parameters:
a – Source direction, of any nonzero length.
b – Target direction, of any nonzero length.
- Returns:
Shortest-arc unit rotation quaternion
qsuch thatquat_rotate(q, normalize(a))equalsnormalize(b).- Return type: