Index Page
cspice_cylrec
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_CYLREC converts cylindrical coordinates to rectangular
   (Cartesian) coordinates.

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

I/O

   
   Given: 
   
      r      a double precision scalar or N-vector describing 
             the distance of the point of interest from z axis.
             Output units are the same as the units associated 
             with 'r'.

      lonc   a double precision scalar or N-vector describing 
             the cylindrical angle of the point of interest
             from XZ plane measured in radians.
             
      z      a double precision scalar or N-vector describing
             the height of the point above XY plane.

   the call:
   
      cspice_cylrec, r, lonc, z, rectan
   
   returns:
   
      rectan   a double precision 3-vector or 3xN array containing
               the rectangular coordinates of the position or set 
               of positions. The output units associated with 'rectan'
               are those associated with the input `z.'

               'rectan' returns with the same measure of vectorization (N)
               as 'r', 'lonc', and 'z'.

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.

      ;; 
      ;; Define six sets of cylindrical coordinates, 'lonc' expressed
      ;; in degrees.
      ;;
      r     = [ 1.d,  1.d,   1.d,   1.d,   0.d,  0.d ]
      lonc  = [ 0.d, 90.d, 180.d, 180.d, 180.d, 33.d ] 
      z     = [ 0.d,  0.d,   1.d,  -1.d,   1.d,  0.d ]

      ;;
      ;; Print a header for the data output.
      ;;
      print, '     r        lonc       z         x          y         z   '
      print, '  --------  --------  --------  --------  --------  --------'

      ;;
      ;; Convert the longitudes to radians.
      ;;
      lonc_rads = lonc * cspice_rpd()

      ;;
      ;; ..convert the cylindrical coordinates to rectangular coordinates
      ;;
      cspice_cylrec, r, lonc_rads, z, rectan

      ;;
      ;; Load the data for easy output.
      ;;
      output      = dblarr( 6, 6 )
      output(0,*) = r
      output(1,*) = lonc
      output(2,*) = z
      output(3,*) = rectan[0,*]
      output(4,*) = rectan[1,*]
      output(5,*) = rectan[2,*]

      ;;
      ;; Output the coordinate table.
      ;;
      print, FORMAT='(6D10.4)', output

   IDL outputs:

        r        lonc       z         x          y         z   
     --------  --------  --------  --------  --------  --------
       1.0000    0.0000    0.0000    1.0000    0.0000    0.0000
       1.0000   90.0000    0.0000    0.0000    1.0000    0.0000
       1.0000  180.0000    1.0000   -1.0000    0.0000    1.0000
       1.0000  180.0000   -1.0000   -1.0000    0.0000   -1.0000
       0.0000  180.0000    1.0000    0.0000    0.0000    1.0000
       0.0000   33.0000    0.0000    0.0000    0.0000    0.0000

Particulars


   None.

Required Reading


   ICY.REQ

Version


   -Icy Version 1.1.1, 05-FEB-2008, EDW (JPL)

      Edited I/O section, replaced comment
      
         "returns with the same order"
      
      with
      
         "returns with the same measure of vectorization"
      
   -Icy Version 1.1.0, 12-SEP-2004, EDW (JPL)

       Added capability to process vectors 'r', 'lonc', and 'z'
       as input, returning array 'rectan' on output.

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

Index_Entries


   cylindrical to rectangular




Wed Apr  5 17:57:59 2017