$LastChangedDate: 27-Juil-2011 $

# CL_rot_quatSlerp

Quaternion interpolation on the unit sphere using Slerp method

## Calling Sequence

       q = CL_rot_quatSlerp(q1,q2,t)

## Description

- 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.

## 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

- CNES - DCT/SB

## See also

- CL_rot_defQuat

- CL_rot_matrix2quat

## 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)