$LastChangedDate: 27-Juil-2011 $

# CL_rot_angles2quat

Rotation angles to quaternion

## Calling Sequence

       q = CL_rot_angles2quat(naxes,angles)

## Description

- Computes the quaternion q that defines the rotation resulting from the combination of 1 to 3 successive elementary rotations, each elementary rotation being described by an axis number (1=x-axis, 2=y-axis, 3=z-axis) and an angle.

## Parameters

naxes :

  Axis numbers: 1=x-axis, 2=y-axis or 3=z-axis (1xP or Px1 with P=1,2 or 3)

angles :

  Rotation angles around respective axes [rad] (PxN)

q :

  quaternion (that defines the rotation) (4xN).

## Authors

- CNES - DCT/SB

## See also

- CL_rot_quat2matrix

- CL_rot_matrix2quat

## Examples

    // 40deg rotation around X followed by 60deg around Y:
    q = CL_rot_angles2quat([1,2], [40;60] * %pi/180)

    // Same considering individual rotations:
    q1 = CL_rot_angles2quat(1, 40 * %pi/180);
    q2 = CL_rot_angles2quat(2, 60 * %pi/180);
    q = q1*q2