Index Page
cspice_rotate
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 

Abstract
I/O
Examples
Particulars
Required Reading
Version
Index_Entries

Abstract


   CSPICE_ROTATE calculates the 3x3 rotation matrix generated
   by a rotation of a specified angle about a specified axis. 
   This rotation operates as a rotation of the coordinate
   system. 

   For important details concerning this module's function, please refer to
   the CSPICE routine rotate_c.

I/O

   
   Given:
   
      angle   a double precision angle of rotation measured in radians

      iaxis   the integer ID of the axis of rotation where
              X=1, Y=2, Z=3

   the call:
   
      cspice_rotate, angle, iaxis, mout
   
   returns:
   
      mout   a double precision 3x3 rotation matrix that describes a
             rotation of 'angle' radians about 'iaxis'
   

Examples


   Any numerical results shown for this example may differ between
   platforms as the results depend on the SPICE kernels used as input
   and the machine specific arithmetic implementation.

      ;;
      ;; A Pi/10 rotation about the Z axis.
      ;;
      cspice_rotate, 0.1d*cspice_pi(), 3, rot_mat
      print, rot_mat

      ;;
      ;; Apply the coordinate rotation to a vector.
      ;;
      vec = [ 1.2d, 3.4d, 4.5d ]
   
      ;;
      ;; First use the Icy matrix vector multiplication 
      ;; routine.
      ;;
      cspice_mxv, rot_mat, vec, vec1
      print, vec1
      
      ;;
      ;; Now use the IDL # operator to perform the same
      ;; calculation, transposing the rot_mat matrix to 
      ;; the IDL nominal format.
      ;;
      vec2 = transpose( rot_mat ) # vec
      print, vec2
   
      ;;
      ;; Finally, use the IDL ## operator to again perform
      ;; the operation, this time as in linear algebra.
      ;;
      vec3 = rot_mat ## vec      
      print, vec3

   IDL outputs for rot_mat:
   
          0.95105652      0.30901699      0.0000000
         -0.30901699      0.95105652      0.0000000
          0.0000000       0.0000000       1.0000000

   IDL outputs for vec1:
   
      2.1919256    2.8627718    4.5000000
   
   IDL outputs for vec2:
   
      2.1919256    2.8627718    4.5000000
   
   IDL outputs for vec3:
   
      2.1919256
      2.8627718
      4.5000000
   
   Note the equality of vec1 and vec2. The numerical values
   of vec3 match those in vec1 and vec2, yet vec3 is a
   column vector (an IDL 1x3 array).

Particulars


   None.

Required Reading


   ICY.REQ
   ROTATION.REQ

Version


   -Icy Version 1.0.1, 26-JAN-2006, EDW (JPL)

      Reformatted Example section to improve reading clarity.

   -Icy Version 1.0.0, 16-JUN-2003, EDW (JPL)

Index_Entries

 
   generate a rotation matrix 
 



Wed Apr  5 17:58:03 2017