Index Page
cspice_cylsph
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_CYLSPH converts cylindrical coordinates to spherical
   coordinates.

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

I/O

   
   Given: 
   
      r      the scalar double precision value for distance of 
             the point from z axis
      
      lonc   the scalar double precision value for the cylindrical 
             angle of the point from XZ plane as measured in radians
             
      z      the scalar double precision value for the height of the 
              point above XY plane
   
   the call:
   
      cspice_cylsph, r, lonc, z, radius, colat, lon
   
   returns: 
   
      radius   the scalar double precision distance of the point from 
               origin
      
      colat    the scalar double precision polar angle (co-latitude) of the
               point measured in radians
      
      lon      the scalar double precision azimuthal angle (longitude) of the
               point measured in radians
   

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       radius     lon      colat  '
      print, '  --------  --------  --------  --------  --------  --------'
   
      ;;
      ;; Loop over each set of coordinates...
      ;;
      for i=0, 5 do begin
   
         ;;
         ;; ...convert the 'lonc' values from degrees to radians
         ;;
         cspice_convrt, lonc[i], 'DEGREES', 'RADIANS', lonc_rads
   
         ;;
         ;; ..convert the cylindrical coordinates to spherical coordinates
         ;;
         cspice_cylsph, r[i], lonc_rads, z[i], radius, colat, lon
   
         ;;
         ;; ...convert the 'lon' and 'colat' values from radians to degrees
         ;;
         cspice_convrt, lon  , 'RADIANS', 'DEGREES', lon_degs
         cspice_convrt, colat, 'RADIANS', 'DEGREES', colat_degs
   
         ;;
         ;; Print the input and corresponding output.
         ;;
         print, FORMAT='(6D10.4)', r[i], lonc[i], z[i], $
                                   radius, lon_degs, colat_degs
   
      endfor
   
   
   IDL outputs:
   
        r        lonc       z       radius     lon      colat  
     --------  --------  --------  --------  --------  --------
       1.0000    0.0000    0.0000    1.0000    0.0000   90.0000
       1.0000   90.0000    0.0000    1.0000   90.0000   90.0000
       1.0000  180.0000    1.0000    1.4142  180.0000   45.0000
       1.0000  180.0000   -1.0000    1.4142  180.0000  135.0000
       0.0000  180.0000    1.0000    1.0000  180.0000    0.0000
       0.0000   33.0000    0.0000    0.0000   33.0000    0.0000

Particulars


   None.

Required Reading


   ICY.REQ

Version


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

Index_Entries


   cylindrical to spherical




Wed Apr  5 17:57:59 2017