You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Daniel Flassig edited this page Jun 24, 2026
·
1 revision
Interpolates between two quaternions along the shortest arc.
This is the spherical linear interpolation, commonly known as SLERP: the result moves at constant angular velocity along the shortest great-circle arc between the two orientations.
This function is located in the pymath module. See pymath for the quaternion representation.
q=pymath.interpolate_quat(q1, q2, t)
Parameter
Type
Description
q1
quaternion
Start quaternion {x, y, z, w} (returned for t = 0).
q2
quaternion
End quaternion {x, y, z, w} (returned for t = 1).
t
number
Interpolation parameter in [0, 1].
Return value
Type
Description
q
A new quaternion interpolated between q1 and q2.
Notes:
At t = 0 the result equals q1; at t = 1 it equals q2.
q1 and q2 should be unit quaternions for the interpolation to describe a pure rotation.
Example:
localq0= {0, 0, 0, 1} -- identity (0°)localq180= {0, 0, 1, 0} -- 180° about zlocalq=pymath.interpolate_quat(q0, q180, 0.5)
-- q == {0, 0, 0.70710678, 0.70710678} -- 90° about z