$LastChangedDate: 27-Juil-2011 $

# CL_rot_angles2matrix

Rotation angles to transformation matrix

## Calling Sequence

       M = CL_rot_angles2matrix(axes,angles)

## Description

- Computes the transformation matrix M that results from the combination of 1 to 3 elementary rotations, each elementary rotation being described by an axis number (1=x-axis, 2=y-axis, 3=z-axis) and an angle.

- Notes:

  M is the frame transformation matrix and its definition is consistent with conventions on reference frame transformations.

  - Let u be the coordinates of some vector in some reference frame. The coordinates of the rotated vector are given by:

  R(u) = M' * u (M transposed)

  - Conversely, let F1 be some reference frame, F2 be the reference frame obtained after applying the successive rotations to F1, u1 the coordinates relative to F1 of some vector, then the coordinates relative to F2 of the same vector are given by:

  u2 = M * u1

## Parameters

axes :

  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)

M :

  Transformation matrix (3x3xN).

## Authors

- CNES - DCT/SB

## See also

- CL_rot_quat2matrix

- CL_rot_matrix2quat

## Examples

    // 30deg rotation around X:
    M = CL_rot_angles2matrix([1],[%pi/3])

    // 30deg rotation around X followed by 90deg around Y:
    M = CL_rot_angles2matrix([1,2],[%pi/3;%pi/2])

    // Meaning of M:
    M = CL_rot_angles2matrix(3, 10*%pi/180)
    u = [1;0;0]  // coordinates of vector u in initial frame
    v = M*u      // coordinates of vector u in final frame
    urot = M'*u  // image of rotation of u in initial frame