Quaternion interpolation on the unit sphere using Slerp method
q = CL_rot_quatSlerp(q1,q2,t)
Interpolates between two quaternions using Slerp method (shortest path).
The interpolated quaternion is computed using q1, q2 and the interpolation parameter t.
- If t == 0 => q = q1
- If t == 1 => q = q2
Notes:
- Let N be the size of q1 and q2, and P be the size of t. Then one must have: N == P or N == 1 or P == 1.
- q1 and q2 may not have the same norm (but the norms should be > 0).
- See Conventions or CL_rot_defQuat for more details on quaternions.
Quaternion with norm > 0 (size N)
Quaternion with norm > 0 (size N)
Interpolation parameter (1xP)
Interpolated quaternion (size max(N,P))
CNES - DCT/SB
// Rotation of angle 15deg around Z-axis : q1 = CL_rot_axAng2quat(CL_deg2rad(15),[0;0;1]); // Rotation of angle 35deg around random axis : q2 = CL_rot_axAng2quat(CL_deg2rad(35),[0;3/5;-4/5]); q = CL_rot_quatSlerp(q1,q2,0) // q = q1 q = CL_rot_quatSlerp(q1,q2,1) // q = q2 q = CL_rot_quatSlerp(q1,q2,[0.5 0.6]) q_vect = CL_rot_quatSlerp([q1 conj(q1)],[conj(q2) q2],-0.2) | ![]() | ![]() |