<< CL_rot_quat2matrix Coordinates and frames CL_rot_rotVect >>

CelestLab >> Coordinates and frames > CL_rot_quatSlerp

CL_rot_quatSlerp

Quaternion interpolation on the unit sphere using Slerp method

Calling Sequence

q = CL_rot_quatSlerp(q1,q2,t)

Description

Parameters

q1 :

Quaternion with norm > 0 (size N)

q2 :

Quaternion with norm > 0 (size N)

t :

Interpolation parameter (1xP)

q :

Interpolated quaternion (size max(N,P))

Authors

See also

Examples

// 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)
<< CL_rot_quat2matrix Coordinates and frames CL_rot_rotVect >>